LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can't import DLL

Solved!
Go to solution

I'm trying to import a DLL created in VC 6.0 into LV2011 and have had no success. I believe the issue lies in the header file, but my C programming skills are average at best.

0 Kudos
Message 1 of 10
(3,296 Views)

Can you be more specific about the problem? What error occurs? Are you providing the path to dllmacros.h as an additional search path when you attempt to import the DLL?

0 Kudos
Message 2 of 10
(3,258 Views)

The following is one of the function errors. All of the functions in the DLL have the same error.

 

DLL_EXTERN( int ) WNClose( WNSession session_id );

 

Undefined symbols can prevent the wizard from recognizing functions and parameters. To correct this problem, check the header file to determine if you must add preprocessor definitions. Click the Back button to return to the previous page of the wizard to add a preprocessor definitionsl (for example, "NIAPI_stdcall = __stdcall" or "NIAPIDefined = 1").
DLLMACROS_H;ENV_VC;USE_DLL;__cplusplus;

0 Kudos
Message 3 of 10
(3,255 Views)

Can you attach the dllmacros.h file? My best guess is that it's finding that file, but not some other file that it includes.

0 Kudos
Message 4 of 10
(3,249 Views)

Requested file is attached

0 Kudos
Message 5 of 10
(3,247 Views)

Unfortunately there's some issue with the import wizard on my machine where it doesn't work when I don't have the actual DLL, despite the checkbox for "DLL is not on the local machine" so I can't fully test this at the moment. However, it would appear that you need to define USE_DLL, and probably also ENV_VC, which you can do by entering them as additional definitions in the import wizard. It might be enough to define the names, but if not, you can set them to 1 (USE_DLL = 1; ENV_VC = 1).

0 Kudos
Message 6 of 10
(3,229 Views)

Tried your recommendation and received the same error.

0 Kudos
Message 7 of 10
(3,225 Views)

I realized you did, in fact, attach the DLL with an earlier message, so I retried, pointing the import wizard at that DLL. Are you sure you attached the correct DLL? At least for me, the import wizard isn't finding the functions from the header file in the DLL; instead, it looks like the DLL you provided is part of an ActiveX library and not a standard DLL.

0 Kudos
Message 8 of 10
(3,219 Views)
Solution
Accepted by topic author CDrew

This is an ActiveX DLL just as Nathan already mentioned. You don't use the DLL import Wizard for this but instead need to write your own VIs that accesses the DLL through the LabVIEW ActiveX interface. Attached are two VIs for the Open and Close calls to the ActiveX interface. The rest you have to implement yourself.

Rolf Kalbermatter
My Blog
Download All
0 Kudos
Message 9 of 10
(3,186 Views)

Perfect... thank you for the great support.

0 Kudos
Message 10 of 10
(3,169 Views)