10-29-2017 07:48 PM
I am writing a wrapper in C# to read TDM files still.
But I met the error code 6202 using DDC_GetNumDataValues.
[DllImport("nilibddc.dll", CallingConvention = CallingConvention.StdCall)] static extern int DDC_GetDataValues(IntPtr channel, ulong indexOfFirstValueToGet, ulong numberOfValuesToGet, IntPtr values); IntPtr databuff = Marshal.AllocCoTaskMem((int)(sizeof(double) * numDataValues)); ret = DDC_GetDataValues(channels[i], 0, numDataValues, databuff);
Does Anyone know how to solve this error?
Thanks for any help.
Solved! Go to Solution.
10-29-2017 11:41 PM
I solved this issue myself.
I wronged the aggument's type.
[DllImport("nilibddc.dll")] static extern int DDC_GetDataValues(IntPtr channel, uint indexOfFirstValueToGet, uint numberOfValuesToGet, IntPtr values); IntPtr databuff = Marshal.AllocCoTaskMem((int)(sizeof(double) * numDataValues)); ret = DDC_GetDataValues(channels[i], (uint)0, (uint)numDataValues, databuff);
Thanks.