LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

What type in Labwindows is equal to Intptr in .Net?

I just want to use Labwindows to write a instrument control Dll for .Net program, it seems I should use Intptr to store the instrument handle in .Net, but ViSession in CVI seems not proper.

 

Could some gent can give an example? Thanks very much!

 

:manhappy:

0 Kudos
Message 1 of 3
(3,185 Views)

ViSession is the correct type for this in C/CVI. ViSession is a UInt32, so you should use System.UInt32 for this in .NET. In .NET, System.IntPtr maps to any pointer type - void* in C. I am not sure why you want to use IntPtr in .NET for this - you should use the type from the native instrument driver, which is ViSession (UInt32) in this case.

0 Kudos
Message 2 of 3
(3,174 Views)
Thanks Mohan! I return to UInt32 instead, it also can work. I just take R&S provided VXI/Plug driver as an example to create my instrument control driver, they use Handref to store VISA session, so I think it is better.
0 Kudos
Message 3 of 3
(3,164 Views)