02-06-2017 01:46 PM
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.
Solved! Go to Solution.
02-06-2017 03:26 PM
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?
02-06-2017 03:32 PM
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;
02-06-2017 03:37 PM
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.
02-06-2017 03:39 PM
Requested file is attached
02-06-2017 04:21 PM
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).
02-06-2017 04:30 PM
Tried your recommendation and received the same error.
02-06-2017 04:51 PM
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.
02-07-2017 07:44 AM
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.
02-07-2017 11:28 AM
Perfect... thank you for the great support.