INF: Using DB-Library Functions From a Windows DLLID: Q105346
|
Writing a user-defined dynamic link library (DLL) for Windows to access DB-Library functions requires special considerations. One consideration that is specific to DB-Library is that a DLL cannot share DBPROCESS connections or error and message handlers between applications. This is because a DLL can be called from many different concurrently running applications.
A DLL runs under the context of the program that called it. This is
important because DB-Library tracks data for each active application
separately. This per-process data includes DBPROCESS connections and
pointers to the error and message handlers. DB-Library does this by
registering the calling application's Windows task handle when
dbinit() is called, and uses that to identify all of the DB-Library data
associated with that application. The dbwinexit() function "unregisters"
the application, and de-allocates the data associated with the process.
In addition, DB-Library for Windows validates each DBPROCESS connection
before using it, using the Windows task handle of the calling application.
If you try to share a DBPROCESS between multiple applications, the
following occurs:
Additional query words: DB-Library dblib Dynamic Link Library
Keywords : kbprg SSrvDB_Lib SSrvProg
Version : 4.2
Platform : WINDOWS
Issue type :
Last Reviewed: March 17, 1999