Hi...
I'm using following program.
NI GPIB driver version 2.4 ( dotNet assembly 7.1.0.273)
Visual studio 2005 express C#.
dotnet framework 2.0
When I used vs2003 , I had no problem of following code (from NI dotnet example)
----start code---------
private void notifyOnDSRButton_Click(object sender, System.EventArgs e)
{
try
{
testDevice.Notify(GpibStatusFlags.DeviceServiceRequest, new NotifyCallback(testDevice_Notify), "Sample user data");
}
catch(Exception exp)
{
MessageBox.Show(exp.Message);
}
}
----end code--------
but When I use above code in dotnet 2.0 and visual c# 2005, I met following run time error.
A call to PInvoke function 'NationalInstruments.NI4882!f::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.
and If I ignore above error, I met "cross thread error".
I read some article about that error at usenet, they said this is dotnet 2.0 feature of thread.
I think NI's new dotnet assembly 8.x.x could solve this type of problem, but you does not provide 8.x.x dotnet assemnbly in your official gpib driver.
How can I use gpib service request notify callback function?
--oldfark---