LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can't import DLL

Solved!
Go to solution

Hi All,

 

I'm trying to use the libsie API to open .sie files from SoMat (there is a plugin for this data format for LabVIEW and DIAdem but it doens't work). I've previously imported dll's using the import wizard with a lot of sucess but I dont' know my way around c or c++ so am a bit stumped on this one. When I try to import the attached dll (you'll need to chage the extension from .doc to .dll) using the attached header file none of the calls show up. They are there in the header file. I'm wondering why this is. Is it a badly formattted header file or is there some other issue?

 

I've attached a copy of the zip file that I downloaded from the HBM website. There is a demo .sie file in there if you want to look at one. There appears to be pretty comprehensive documentation on the API on the website.

 

Any help or pointers gratefully received.

 

Phil

Download All
0 Kudos
Message 1 of 5
(4,155 Views)

The header file makes use of macros to set up the function declarations differently depending on how it's compiled. The DLL import utility can't handle macros like this. Unfortunately the best solution will be to configure the DLL calls yourself, manually, based on the function declarations in the file. Alternatively you could make a copy of the header file and edit it to remove the SIE_DECLARE macro, replacing it manually with its equivalent, and see if the DLL import utility can then read it properly.

0 Kudos
Message 2 of 5
(4,125 Views)

Cheers for the response.

 

I've since looked into it and the dll is written in object oriented C which I believe LabVIEW cannot handle. Is that the case?

 

PHil

0 Kudos
Message 3 of 5
(4,117 Views)
Solution
Accepted by topic author therealkilkenny

It doesn't matter what language was used to create the DLL, so long as it exports a C-compatible interface (which it does).

 

If you make a copy of the header file and remove SIE_DECLARE(), leaving whatever is inside the parentheses unchanged, from each function declaration, I suspect you'll be able to import at least some of the functions. I don't know how well the import utility will handle the pointer data types, you might have to edit each Call Library Function Node to fix them manually after importing.

Message 4 of 5
(4,113 Views)
Cheers. Looks like it is working now.

Phil
0 Kudos
Message 5 of 5
(4,102 Views)