How To Export Callback FunctionsLast reviewed: December 16, 1996Article ID: Q83706 |
The information in this article applies to:
SUMMARYIt is not necessary for Win32-based applications to export callback functions. Windows versions 3.1 and earlier (Win16) need callback functions primarily for fixing references to global data and ensuring that EMS memory is not paged out. Neither of these situations applies to the Windows NT operating system.
MORE INFORMATIONExports are necessary for any function that must be located at either
Static linking is done by the loader, which performs this lookup for all of the imported entry points that an executable needs (normally by ordinal number). In dynamic linking, the system scans by ordinal number or by name through the DLL (Dynamic Link Library) exports table. In Win16, exported entries are automatically fixed by the linker to adjust to the appropriate data segment. Exporting entries on Win32 just adds them to the module's exported names and ordinal numbers table; the linker does not need to "fix" them. For code compatibility with Win16, you may want to continue to use MakeProcInstance() and export all callbacks. This macro does nothing on Windows NT. In short,
On Windows Win32 --------------------------- ----------------- Callbacks Export or use MakeProcInstance Use address of fn GetProcAddress Must export Must export Static linking Must export Must export |
Additional reference words: 3.10 3.50 4.00 95
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |