Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI

Calling a DLL in CVI: Explicit Linking vs. Implicit Linking (Dynamic vs. Static)

1 ratings | 5.00 out of 5
Print

Overview

The following Example demonstrates how to call a Dynamic Link Library (DLL) from LabWindows/CVI.

Downloads

Filename: calling_dll_from_cvi.zip
Requirements: View

There are two methods of calling a function in a DLL:

  • Implicit Linking
  • Explicit Linking

For more information on calling DLLs from CVI using implicit and explicit linking, please refer to the following article:
DeveloperZone Tutorial: Calling DLLs in CVI: Explicit Linking vs. Implicit Linking (Dynamic vs. Static)

Attachments

The attachment contains two separate LabWindows/CVI Projects:

    • SimpleDLL: The code for the DLL.
      The DLL exports one function. This function simply takes an integer and a string, displays them and returns 1.
    • CallingADLLFromCVI: The main application.
      The GUI allows the user to pick a number and a string to send to the DLL function, and has two buttons, one to call the DLL statically, and another to call the DLL dynamically.

Additional References

For a more in-depth reference on when to use Implicit vs Explicit Linking, please refer to the following article:
MSDN: Determining Which Linking Method to Use 

To learn more about where Windows searches for DLLs and what order it searches in, please refer to the following article:
KnowledgeBase 4U4EC9PE: Where Does Windows Search for DLLs?

For more information on calling DLLs from CVI using implicit and explicit linking, please refer to the following article:
DeveloperZone Tutorial: Calling DLLs in CVI: Explicit Linking vs. Implicit Linking (Dynamic vs. Static)

Requirements


Filename: calling_dll_from_cvi.zip

Software Requirements


Application Software: LabWindows/CVI Full Development System 9.0
Language(s): C

 
1 ratings | 5.00 out of 5
Print

Reader Comments | Submit a comment »

 

Legal
This example program (this "program") was developed by a National Instruments ("NI") Applications Engineer. Although technical support of this program may be made available by National Instruments, this program may not be completely tested and verified, and NI does not guarantee its quality in any way or that NI will continue to support this program with each new revision of related products and drivers. THIS EXAMPLE PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND AND SUBJECT TO CERTAIN RESTRICTIONS AS MORE SPECIFICALLY SET FORTH IN NI.COM'S TERMS OF USE (http://ni.com/legal/termsofuse/unitedstates/us/).