LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Access win32 DLL created in VC 6.0 in labwindows

Hi ,
 
I have created a win32 DLL with Header file and Lib file using VC 6.0.
I have used "#import" syntaxes too. But i am not able to use it in the Labwindows as it cannot able to recognise these syntaxes including extern "C" too.
 
Can u please tell me step by step procedure for accesing it thru labwindows.?
 
 
Selva
0 Kudos
Message 1 of 4
(3,633 Views)

Selva,

The good news is that it can be done, and without too much hassel.  I have several projects where I access DLLs from LabWindows/CVI built in various version of Visual Studio (including 6.0).

The following two links should be very helpful to your endeavor:

http://zone.ni.com/devzone/cda/tut/p/id/3341

http://digital.ni.com/public.nsf/allkb/EC2ECA974F8763D586256929006D17D7

Best regards,

Kevin C.

0 Kudos
Message 2 of 4
(3,625 Views)
Thanks for your kind response.
I did the same steps specified in those two links.
But i am not able to access the Type Library file by giving #import "file.tlb" in the header file.
 
Is there any alternative to access the tlb file in labwindows?
 
 
Thanks
Selva
0 Kudos
Message 3 of 4
(3,620 Views)
Hi Selva,

I am not quite sure I understand your actual problem. Did you create a Win32 DLL or an ActiveX DLL?

To use Win32 DLLs in CVI you can either
1) Use LoadLibrary and GetProcAddress to dynamically load the DLL. See the KnowledgeBase How Can I Access DLL Functions in a LabWindows/CVI Program Without Including the Import Library in t...

2) Add the import library (.lib) file and the header file (.h) to the project and statically link to the DLL.

In either case, since its a C++ DLL, you must use the extern "C" statement as mentioned in those tutorials to tell the C++ compiler not to mangle the function names.  Then you can use that C++ DLL in CVI. You must also make sure that you don't export any C++ spefic types like classes as C compilers like CVI don't understand that.

If you created an ActiveX DLL, you will have a type library associated with that and you can use our ActiveX Controller Wizard and our ActiveX library to communicate with that server.

Make sense?

Best Regards,
Jonathan N.
National Instruments
0 Kudos
Message 4 of 4
(3,596 Views)