Example Code

Exporting Variables and Functions from a DLL in LabWindows/CVI

Code and Documents

Attachment

This example shows how to apply the correct import and export qualifiers for variables and functions defined in a DLL and used in an external application. For exporting, notice the use of the DLLEXPORT macro; for importing a variable, notice the use of the DLLIMPORT macro. These macros are defined in cvidef.h and help you identify the correct qualifiers for your compiler.

This example program contains two projects: export.prj contains the source for the DLL and useexport.prj uses the DLL. Look at both to understand the complete implications of exporting and importing a variable and using a function defined in a DLL.

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Contributors