tags:

views:

102

answers:

0

How do I store values in an array of structures?

MydatainfoArray is the array of the structures, and here is how I get the values using the function SDK_Get:

MydatainfoArray Mydtinfo = new MydatainfoArray();

IntPtr MyinfoBuffer = IntPtr.Zero; 
int FIN = Marshal.SizeOf(Mydtinfo); 
MyinfoBuffer = Marshal.AllocCoTaskMem((int)FIN);
 Marshal.StructureToPtr(Mydtinfo, MyinfoBuffer, true);

Mydatainfo onedinfo = new Mydatainfo();
 List MyinfoData = new List();

SDKRet = SDK.SDK_Get(deviceIndex, 0, MyinfoBuffer);

onedinfo = (Mydatainfo)Marshal.PtrToStructure(MyinfoBuffer, onedinfo.GetType()); 
MyinfoData.Add(onedinfo);

How can I store the values in an array of structure using a the function SDK_Set?

SDK_Get and SDK_Set are functions in my dll.