I've got a very strange error.
I get an error message:
"Object reference not set to an instance of an object",
which I've seen many times before, for good reason. But
this time, I cannot find fault with my code.
Here's my function call:
eError = CUCanApi.eUCanGetBootFirmwareInfo( hDevice, out
fw, 1000 );
The problem appears to be with the argument hDevice,
which is an IntPtr type. I set it with another function
called hDUT(), which returns an IntPtr type.
If I check hDevice just before the call of
eUCanGetBootFirmwareInfo, it appears to have a valid
value.
If I replace the hDevice argument with "(IntPtr)0", then
the error message goes away, indicating that I've
resolved the object reference issue.
Any ideas on what the problem is?