DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

DDC_GetNumDataValues shows error code 6202

Solved!
Go to solution

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.

0 Kudos
Message 1 of 2
(2,926 Views)
Solution
Accepted by topic author Takayama

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.

 

 

 

0 Kudos
Message 2 of 2
(2,900 Views)