LabWindows/CVI

Table of Contents
  • LabWindows/CVI Fundamentals
  • Creating Applications
  • Distributing Applications
  • Library Reference
  • Programmer Reference
  • Hardware Information

Generating DLL Import Source

This command generates source code that you can use to create a DLL import library. In general, it is not necessary to use this command. For most cases, you can generate a DLL import library directly using the Generate DLL Import Library command. Use this command only when you must perform special processing in the DLL import library. LabWindows/CVI never requires such special processing.

LabWindows/CVI enables the Generate DLL Import Source command only when you have an include file in the Source window. The include file must contain declarations of all the DLL functions you want to access. When you execute the command, a dialog box appears in which you enter the pathname of the DLL.

The Generate DLL Import Source command generates the import library source into a new Source window. You can modify the code, including making calls to functions in other source files. Create a new project that contains the source file and any other files it references. Select Build»Target Type»Static Library in the Workspace window. Execute the Build»Build command.

Notes  
  • You cannot export variables from a DLL using the import library source code this command generates. When you want to export a variable, create functions to get and set its value or create a function to return a pointer to the variable.
  • When you edit the source code this command generates, you cannot use the __import qualifier in the function declarations in the DLL include file.
  • The import source code does not operate in the same way as a normal DLL import library. When you link a normal DLL import library into an executable, the operating system attempts to load the DLL as soon as the program starts. The import source code operates in such a way that the DLL does not load until the user makes the first function call into it.

Log in to get a better experience