LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

dll load on demand

Hello

I have a lot of equipment drivers which I don't use all at one time. So I would only like to lead the equipment's dll on demand. The cvi manual is not clear here for me. There is well a load dll ex. but
  1. How do I tell cvi that it shall load a driver only on demand?
  2. How do I avoid the "symbol not found" during compilation?
  3. The manual talks about redefine all symbol pointers after loading. That would be quite some work, really needed?
Some example would be nice, anyone has some code and description?
0 Kudos
Message 1 of 2
(3,819 Views)

Hi tisiman,

There are two ways of linking a DLL in LabWindows/CVI:

- Static linking (linking implicitly): In this case, the DLL will be loaded into memory when the application is loaded. This method uses the header file and import library of the DLL. You will include the import library in your CVI project.

- Dynamic linking (linking explicitly):  In this case, the DLL will be loaded into memory when the user says so by using the LoadLibrary and GetProcAddress Windows SDK functions.  This is explained in the How Can I Access DLL Functions in a LabWindows/CVI Program Without Including the Import Library in t... KnowledgeBase.

In your case, dynamic linking is the approach you want to take. 

With static linking, function calls will be resolved during link time by CVI and if it can't find the appropriate symbol, it will provide that "symbol not found" error.

The above information is discussed in the Linking to Functions Defined in a DLL From LabWindows/CVI KnowledgeBase and the FAQ: Using Dynamic Link Libraries with LabWindows/CVI tutorial.

Hope this helps!

Best Regards,

Message Edited by Jonathan N on 05-19-2007 08:45 AM

Jonathan N.
National Instruments
Message 2 of 2
(3,813 Views)