Re: Location of custom DLL for use with MSAccess



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



.



Relevant Pages

  • Re: Service pack 3 problem
    ... Opening the regsvr32 file is as you say, no dll specified, followed by the ... and no dllcache folder exists, ... After show hidden files, folders, and system files, use WINDOWS Explorer ...
    (microsoft.public.windowsxp.general)
  • Re: WinSxS, functional under 2k ?
    ... The newSide-by-Side Assembly technology was introduced with Windows XP to help reduce or eliminate DLL Hell. ... If you recall earlier Windows versions, like Windows 95, when you installed an application you were warned if the installer tried to replace a DLL from the system folder with an older version and you were asked if you wanted to accept the change. ... Until Windows XP it wasn't so easy to use different versions of shared system DLLs, that is what the new Side-by-Side assemblies attempts to resolve. ...
    (microsoft.public.win2000.general)
  • Re: Honestly Curious
    ... makes it necessary to put parts of the code outside the app. ... *all* Windows apps need to use dlls. ... Never heard of "dll Hell"? ... But then neither is using an uninstaller. ...
    (comp.sys.mac.advocacy)
  • Re: Location of custom DLL for use with MSAccess
    ... folder as the MDB, they should be found. ... I have developed a DLL in C++ for use with an Access 97 database ... development environment) and Windows XP. ... containing the MDB file, ...
    (microsoft.public.access.formscoding)
  • Re: Heavy Application with Multiple Modules
    ... When you do a new project, the template for a DLL is called a Class Library. ... Start with a brand new project, a Windows ... This creates a reference from your main app ... so you can use it in the main app. ...
    (microsoft.public.dotnet.languages.vb)

Loading