National Instruments 320685D-01 Drums User Manual


 
Chapter 3 Windows 95/NT Compiler/Linker Issues
©
National Instruments Corporation 3-13 LabWindows/CVI Programmer Reference Manual
module references any of the commonly used Windows SDK functions, you can use the
cvi\sdk\include\basicsdk.h file.
Execute the External Compiler Support command in the Build menu of the Project window.
A dialog box appears. Enable the Using Load External Module option. Enable the Other
Symbols checkbox if it is not already enabled. Enter the pathname of the include file in the
Header File control. Enter the pathname of the object file to generate in the Object File
control. Click on the Create button to the right of the Object File control.
Include the object file in the external compiler project you use to create your executable. Also,
you must call
InitCVIRTE at the beginning of your main or WinMain function. Refer to the
Calling InitCVIRTE and CloseCVIRTE section later in this chapter.
Resolving Run-Time Module References to Symbols Not Exported
from a DLL
When you load an object or static library file from a DLL, you might want to resolve
references from that module using global symbols the DLL contains, but does not export. You
can do this by calling
LoadExternalModuleEx. When you pass the DLL module handle to
LoadExternalModuleEx, the Utility Library searches the symbol table the DLL contains
before searching the table that the executable contains. Refer to Chapter 8, Utility Library, of
the LabWindows/CVI Standard Libraries Reference Manual for detailed information on
LoadExternalModuleEx.
If you create your DLL in LabWindows/CVI, LabWindows/CVI includes the table of symbols
in the DLL automatically. If you create your DLL using an external compiler, the external
compiler does not make such a table available to the Utility Library. Thus, when you use an
external compiler, you must include in your DLL one or more object files that contain the
necessary symbol tables. You can do this using the technique that the previous section,
Resolving References to Symbols Not in Run-Time Engine, describes. You must call
InitCVIRTE and CloseCVIRTE in your DLLMain function. Refer to the Calling InitCVIRTE
and CloseCVIRTE section later in this chapter.
Run State Change Callbacks Are Not Available in External Compilers
When you use a compiled module in LabWindows/CVI, you can arrange for
LabWindows/CVI to notify the module of a change in the execution status such as start, stop,
suspend, or resume. You do this through a callback function that is always named
__RunStateChangeCallback. The Notification of Changes in Run State section, in
Chapter 2, Using Loadable Compiled Modules, of this manual, describes this in detail.
The run state change callback capability in LabWindows/CVI is necessary because the
LabWindows/CVI development environment executes your program as part of the
LabWindows/CVI process. When your program terminates, the operating system does not
release resources as it does when a process terminates. LabWindows/CVI attempts to release
00ProRef.book : 06chap03.fm Page 13 Monday, March 9, 1998 3:23 PM