From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

can i use dll which is created in BC++ in cvi5.0 without lib?

I have a dll created in BC++,I want to use it in cvi,when i choose
Option->generate import libary,cvi always tell me dll is damaged.Is it
possible for me to use dll without lib? or can i use the former lib
created by BC++?
Hope any help!
0 Kudos
Message 1 of 5
(2,829 Views)
Yes, you should be able to use the DLL in CVI, as long as you have C functions in it, not C++ since CVI is a C compiler. You would use LoadLibrary and GetProcAddress to load the DLL and call the functions. See the Windows SDK help for more information.

Best Regards,

Chris Matthews
National Instruments
0 Kudos
Message 2 of 5
(2,829 Views)
Dear Chris Matthews :
Thank you very much for your answering.
I want to ask you another question,when cvi generate lib for my
dll,cvi tell me dll is damaged,but my dll is not damaged because I can
use it in BC++.
It can generate lib for another dll,but the funtion is not in the
dll.I am confused,could you give me some advices?
Thank you!
0 Kudos
Message 3 of 5
(2,829 Views)
TO use a CVI-generated DLL in CVI, you'll have two projects. To the project where you built the DLL, you need to add a .h file which has the prototypes for all the functions you want to export (make available to other applications). You also need to select that .h file under Build >> Target Settings >> Exports >> Change (using CVI 6.0 menus). Then, to the project from which you'll call your DLL functions, you need to add the .lib file from your DLL project.
0 Kudos
Message 4 of 5
(2,829 Views)
There are several reasons the import library generation could fail. There could be data types causing the problem, or C++ features like function overloading.

Chris
0 Kudos
Message 5 of 5
(2,829 Views)