June 3,2006
將傳統structure pointer 加入 .NET collection 物件中管理
很簡單......就是IntPtr
Struct testStruct{
int a;
int b;
};
testStruct *ts = new testStruct;
ArrayList^ tList = gcnew ArrayList();
tList->Add(gcnew IntPtr(ts));
-------------------------------------------------
取出:
testStruct *ts;
ts = (IntPtr^)tList[0]->ToPointer();
ts->a = 10;
ts->b = 10;
引用URL
http://cgi.blog.roodo.com/trackback/1704011