2006-12-01から1ヶ月間の記事一覧
C++/CLI側 void CPP(int% a) { a++; }C#側 int a = 0; CPP(ref a); ->a==1トラッキング参照とかいうのだそうで http://ja.wikipedia.org/wiki/C++/CLI
short[] x = new short[10]; double[] y; x.CopyTo(y,0);だとエラー short[] x = new short[10]; double[] y = new double[x.Length]; x.CopyTo(y,0);だと正常.
double[][] Original = new double[num][]; ... double[] jointdata = new double[1000 * num]; for (int i = 0; i < num; i++) { Original[i].CopyTo(jointdata, 1000*i); }これってCopyToだからコピーなんだよな.参照とかポインタだけ渡せないのかな… (un…
//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 #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…