Admin Production ni-theme
Current Publication

Recommendations for Creating a DLL

LabWindows/CVI

Recommendations for Creating a DLL

To make creating a DLL as simple as possible, adhere to the following recommendations:

  • Use the DLLSTDCALL macro in the declaration and definition of all functions you want to export. Do not export functions with a variable number of arguments.
  • Identify the symbols you want to export using the include file method. Do not use export qualifiers. If you use an external compiler, use the .def file method.
  • Do not export variables from the DLL. For each variable you want to export, create functions to get and set the variable value or a function to return a pointer to the variable. Do not use import qualifiers in the include file.

If you follow these recommendations, you gain the following benefits:

  • You can distribute with your DLL the same include file that you include in the source files you use to make the DLL. This is especially useful when you create DLLs from instrument drivers.
  • You can use the same source code to create the DLL in LabWindows/CVI and the external compiler.
  • You can use your DLL in Microsoft Visual Basic or other non-C environments.