National Instruments 320685D-01 Drums User Manual


 
Chapter 4 Windows 3.1 Compiler/Linker Issues
©
National Instruments Corporation 4-15 LabWindows/CVI Programmer Reference Manual
failed:
FreeCallbackResources();
return FALSE;
}
/* Call this function after unregistering the callback. */
void FreeCallbackResources(void)
{
if (CallbackData.proc16Instance) {
FreeProcInstance(CallbackData.proc16Instance);
CallbackData.proc16Instance = 0;
}
if (CallbackData.proc16) {
ReleaseProc16(CallbackData.proc16);
CallbackData.proc16 = 0;
}
if (CallbackData.UserDefinedProcHandle) {
FreeProcUserDefinedHandle(CallbackData.UserDefinedProcHandle);
CallbackData.UserDefinedProcHandle = 0;
}
}
If the DLL Returns Pointers
DLLs return pointers that fall into the following two classes.
Pointers to memory that LabWindows/CVI allocates, that you pass into the DLL, and that
the DLL later returns
You must map these pointers back into normal 32-bit pointers that you can use in
LabWindows/CVI code. Use the function
MapAliasToFlat to convert these pointers.
Pointers to memory that a DLL allocates
Because these pointers point to memory that is not in the LabWindows/CVI flat address
space, you cannot map them back into the normal 32-bit pointers that LabWindows/CVI
uses. You can access them in Watcom object code by first converting them to 32-bit far
pointers using the function
MK_FP32.
To access them in LabWindows/CVI source code you must copy the data into a buffer
you allocate in LabWindows/CVI. Notice that you cannot pass 16- or 32-bit far pointers
to LabWindows/CVI library functions, and that LabWindows/CVI does not provide
access to the Watcom string and memory buffer manipulation functions that take far
pointers as arguments. You must write the loops to copy the data.
00ProRef.book : 06chap04.fm Page 15 Monday, March 9, 1998 3:23 PM