PRB: Problems When W3DBLIB.DLL is Loaded at Run-TimeLast reviewed: April 25, 1997Article ID: Q72201 |
The information in this article applies to:
SYMPTOMSAttempting to load W3DBLIB.DLL at run-time in a program [by calling LOADLIBRARY()], and then attempting to get the address of a function by calling GetProcAddress(hLibrary, "<function_name>"), will return a NULL pointer.
CAUSEWindows assumes that all procedures are defined with the PASCAL calling sequence; therefore, the application always looks for the function name to be in uppercase letters when GetProcAddress() is called. Functions declared with the C calling convention are case sensitive. DB-Library (DB-Lib) functions use the C calling convention and are in all lowercase letters; therefore, Windows cannot load these functions when they are referenced by name.
WORKAROUNDPass the ordinal number of the db-lib functions (assigned in the .DEF file) to GetProcAddress(). For example:
GetProcAddress(hLibrary,MAKESOURCE(43)); // dbinitThe ordinal numbers of the DB-Lib functions can be obtained by using the EXEHDR program against W3DBLIB.DLL.
STATUSMicrosoft has confirmed this to be a problem in SQL Server version 4.2. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.
|
Additional query words: Programming tools - windows dblib
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |