I had code where I used the "Notify" method of class "NationalInstruments.NI4882.Device" to set a callback method when RQS bit is set. My code worked great with VS2003. Now I tried the same code with VS2005 and I get the error below:
PInvokeStackImbalance was detected
Message: A call to PInvoke function 'NationalInstruments.NI4882!g::a' has unbalanced the stack. This is likely because the managed PInvoke signature does not match the unmanaged target signature. Check that the calling convention and parameters of the PInvoke signature match the target unmanaged signature.
This happens only in debug mode and I came across someone who had similar issue and the suggested resolution was to press continue button. Well, I really don't like that resolution if I am dealing with 20 pieces of equipment and I have to press continue for every instance of the Device class. I also saw a comment that setting "Control.CheckForIllegalCrossThreadCalls" to false would take care of this issue; however, it didn't work on my pc.
I already tried the latest Measurement Studio release 8.01 and I still get same error.
Regards,
Rudy.