Re: Location of custom DLL for use with MSAccess
- From: "Stephen Lebans" <ForEmailGotoMy.WebSite.-WWWdotlebansdot...@xxxxxxxxxxxx>
- Date: Sun, 5 Nov 2006 13:04:41 -0400
Hi Doug,
it has to be in the same folder as the FE of your app. Also, you can place
it on a network share but I find you have to then hard code the path to the
function declarations. I'm not sure why the OP states that placing the DLL
in the same folder as his app causes a failure.
The rules for Windows to search/find DLL's are clearly stated on the MSDN
site. I think the starting point is LoadLibrary. The OP could use
Loadlibrary to force the loading of his DLL from a specified location
determined at runtime.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/loadlibrary.asp
--
HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
"Douglas J. Steele" <NOSPAM_djsteele@xxxxxxxxxxxxxxxxx> wrote in message
news:OjS58fPAHHA.4808@xxxxxxxxxxxxxxxxxxxxxxx
I believe (but can't test at the moment) that if you put them in the same
folder as the MDB, they should be found.
--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)
"Bob Hairgrove" <invalid@xxxxxxxxxxx> wrote in message
news:aatrk2hame23o82l04nalu1fji2db24l17@xxxxxxxxxx
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.
--
Bob Hairgrove
NoSpamPlease@xxxxxxxx
.
- Follow-Ups:
- Re: Location of custom DLL for use with MSAccess
- From: Bob Hairgrove
- Re: Location of custom DLL for use with MSAccess
- From: Bob Hairgrove
- Re: Location of custom DLL for use with MSAccess
- References:
- Location of custom DLL for use with MSAccess
- From: Bob Hairgrove
- Re: Location of custom DLL for use with MSAccess
- From: Douglas J. Steele
- Location of custom DLL for use with MSAccess
- Prev by Date: Re: Location of custom DLL for use with MSAccess
- Next by Date: Re: Method or Data Object Not Found
- Previous by thread: Re: Location of custom DLL for use with MSAccess
- Next by thread: Re: Location of custom DLL for use with MSAccess
- Index(es):
Relevant Pages
|
Loading