LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Linking C++ DLL into LabVIEW

Solved!
Go to solution

Sorry Nathand,

for copyright reasons I can't put on line the entire .h, but I assure you what I wrote it's very indicative: The first function has been seen from wizard but it cannot import it.

I've tried with call library node but I have tenths of functions. So I'm trying to save time 

0 Kudos
Message 11 of 14
(1,433 Views)
When you configure the import wizard, did you define _cpluplus or __cpluplus? Is __stdcall defined? Does the wizard give you any errors about undefined symbols?
0 Kudos
Message 12 of 14
(1,425 Views)

I pasted your header excerpt into a new text file and tried to import it. It appears that the import wizard doesn't like the return type of LONG. Adding LONG=int (which admittedly might not be correct) to the preprocessor definitions allowed the wizard to see the MY_Create function.

0 Kudos
Message 13 of 14
(1,419 Views)

LONG is a Windows header definition, not a C compiler standard datatype. The import library wizard does go at great lengths (to much in my opinion in some cases) to guess the environment and support standard C datatypes, but it can't and shouldn't start doing this for platform specific datatypes. After all LabVIEW is not only running on Windows and even under Windows you have various versions of Microsoft SDKs with sometimes colliding definitions. In addition there are various open source and not so open source libraries with yet again their own variant of datatypes.

 

So you do need to setup the import library wizard configuration to point to a (the) valid Windows SDK and other SDK header locations, in order for it to be able to recognize such datatypes. Or what is usually easier but requires nevertheless some C programming knowledge, add those missing defines yourself directly to the wizard configuration.

Rolf Kalbermatter
My Blog
0 Kudos
Message 14 of 14
(1,403 Views)