2006-12-12から1日間の記事一覧

バイナリファイル読み込み(read binary file)

//before char tmp; info145 = gcnew array<unsigned char>(size); for(unsigned int i=0;i<size;i++){ fin.get(tmp); info145[i]=static_cast<unsigned char>(tmp); } //after unsigned char *data; data = new unsigned char[size]; fin.read((char*)data,sizeof(unsigned char)*size);fin.get(tmp)で1byteずつ読んでたら,相当時間かかっ…</size;i++){></unsigned>

pure CのDLLから呼び出し元C#へのコールバック

///pure C DLL #include "windows.h" #define DLLEXPORT __declspec(dllexport) extern "C" { DLLEXPORT int __stdcall MyFunc(int (*callback)()) { return callback(); } } ///C# class DLL { [DllImport"hoge.dll", CallingConvention = CallingConventio…