LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

third-party C++ Driver : Static object

Hello,
I'm writting a C++ driver for Labview RT.
I'm using Visual C++ to compile and link this driver.
I have some initialisation problem on the target.
It seems that static object are not created correctly. All members are not created correctly and it crashes as soon as I use these objects.

Could someone confirm this problem ?
Is there someone develop a C++ driver (based on VISA) for Labview RT ? Thanks for your responses !

David Chuet
0 Kudos
Message 1 of 2
(2,364 Views)
David:

For starters, note that NI does not officially support MSVC-built DLLs on LabVIEW RT. I believe we only officially support DLLs built with LabVIEW or CVI. However, in most cases MSVC-built DLLs will work fine.

As to your specific question, you are correct. C++ static objects don't get initialized. Realize that the LabVIEW RT OS (Phar Lap ETS) is Win32-like. In other words, it is not 100% compatible with Win32 and MSVC, but it is extremely compatible with a large subset of the two. This is probably the biggest difference I can think of.

My suggestion is to have static pointers to objects, then initialize them in your DLLmain. That does work and that's how we do it in NI-VISA.

Dan Mondrik
National Instruments
0 Kudos
Message 2 of 2
(2,364 Views)