B
Bob Hairgrove
I have developed a DLL in C++ for use with an Access 97 database
application. The OS it will run on is Windows 2000 Professional (my
development environment) and Windows XP (my client has this).
Usually, I only do this sort of thing when I need to call some Windows
API functions. Those DLLs are always in the Windows system32
directory. ActiveX DLLs are registered in the Windows registry, so
Access can find those. This time, however, there is no COM involved;
all the exported functions are declared extern "C" __stdcall, and the
function names are exported undecorated by using a DEF file when
building the DLL.
All is well when the DLL is either in the Windows system32 directory
or in the directory where MSAccess.exe is; if I put it in the folder
containing the MDB file, Access cannot find the DLL. Obviously, it's
not a good idea to hard-core the file path in the class module's
"Private Declare Function ... Lib "MyDLL.dll" (etc.) because the
client might not have the same folder. Putting it in the user's
Application Data folder doesn't work, either (at least not on Windows
2K using MSAccess 97). And I'd rather not put it in the system32
directory because it is easily forgotten there, and it might get in
the way when an update is due.
What is the usual way out of this mess? Is there some documented (or
undocumented) way of adding directories to search when Access loads
the DLL?
Thank you.
application. The OS it will run on is Windows 2000 Professional (my
development environment) and Windows XP (my client has this).
Usually, I only do this sort of thing when I need to call some Windows
API functions. Those DLLs are always in the Windows system32
directory. ActiveX DLLs are registered in the Windows registry, so
Access can find those. This time, however, there is no COM involved;
all the exported functions are declared extern "C" __stdcall, and the
function names are exported undecorated by using a DEF file when
building the DLL.
All is well when the DLL is either in the Windows system32 directory
or in the directory where MSAccess.exe is; if I put it in the folder
containing the MDB file, Access cannot find the DLL. Obviously, it's
not a good idea to hard-core the file path in the class module's
"Private Declare Function ... Lib "MyDLL.dll" (etc.) because the
client might not have the same folder. Putting it in the user's
Application Data folder doesn't work, either (at least not on Windows
2K using MSAccess 97). And I'd rather not put it in the system32
directory because it is easily forgotten there, and it might get in
the way when an update is due.
What is the usual way out of this mess? Is there some documented (or
undocumented) way of adding directories to search when Access loads
the DLL?
Thank you.