Chapter 4 Windows3.1 Compiler/Linker Issues
©
National Instruments Corporation 4-7 LabWindows/CVI Programmer Reference Manual
/* perform the computations */
.
.
.
/* restore the floating point state */
_FPTerm (OldFPHandler);
}
Note If you use Microsoft C to build the DLL, you might get a linker error for an
undefined symbol _acrtused2. This error occurs only in MicrosoftC
versions 7.00 and later. Include the following dummy function in your
DLL to fix this error. Also, when linking to the DLL, specify WIN87EM.LIB
as the first library to be linked.
void _acrtused2 (void)
{
}
DLL Glue Code
Because LabWindows/CVI is a 32-bit application, it does not use 16-bit import libraries or
import statements in module definition files. Instead, LabWindows/CVI uses 32-bit DLL glue
code. In some cases, it is sufficient to use glue code that LabWindows/CVI automatically
generates when it loads the DLL. However, you cannot use this method in the following
cases:
The DLL requires special interface functions compiled outside of the DLL.
You expect to pass arrays bigger than 64 K to functions in the DLL.
You pass a pointer to a function in the DLL, and the DLL uses the pointer after the
function returns. For example, you pass an array to a function that starts an asynchronous
I/O operation. The function returns immediately, but the DLL continues to operate on the
array.
Y ou pass a f unction pointer to the DLL, and the DLL calls the f unction later . For example,
the DLL makes a direct callback into 32-bit code.
Y ou pass to the DLL a pointer that points to other pointers. Two examples of pointers that
point to other pointers are an array of pointers and a structure pointer with pointer
members.
The DLL returns pointers as return values or through reference parameters.
The DLL exports functions by ordinal value only.
If your DLL falls into any of these categories, refer to the DLLs That Cannot Use Glue Code
Generated at Load Time section of this chapter for details on how to proceed. Otherwise, refer
to the DLLs That Can Use Glue Code Generated at Load Time section, also in this chapter.

00ProRef.book : 06chap04.fm Page 7 Monday, March 9, 1998 3:23 PM