LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

working with dll

Hi,
I"m working with CVI7.0 and try to use a dll for Anritsu MP1570. What i found in the ziped file from Antrisu is a list of files including 2 dll's (one for the instrument, one for working with CVI) and a bunch of h files.

I put the two dlls in c:\VXIPNP\WINNT\bin (where the rest of the instruments dll's are) and included the h files in my c code. It passed the compilation but gave my a link error: 'Undefined Symbol...'

With my other instruments I have the source files, so, I compile them (with a seperate project) and creats a .lib file which I, then, includ in my main project.

What do I do in this case when I don't have the source?

Thanks
Rafi
0 Kudos
Message 1 of 4
(3,420 Views)
1. Open the top level .h file in a CVI source code window. If there's not a top level .h file, you can create your own, selecting which DLL functions you want to call from CVI. You can cut and paste or #include the .h files with functions you need into your top level file. You can create your own .h file name: it's convenient (but not necessary) to have the .h file, .dll and .lib all the same name.
2. From the menu on the source code window (with your top level .h file open), select Options >> Generate DLL Import Library. If the name of the DLL doesn't match the name of the .h file, you'll be prompted to browse to the correct DLL.
3. Goto your CVI project window and select Edit >> Add Files to Project >> Library and browse to the newly created .lib file. The .lib f
ile will have the same name as the .h file.
0 Kudos
Message 2 of 4
(3,420 Views)
If you created a new .h file to generate the .lib file, you'll have to #include that file in any .c file that uses the DLL functions.
0 Kudos
Message 3 of 4
(3,420 Views)
I got it, thank you very much.
0 Kudos
Message 4 of 4
(3,420 Views)