Full Version: Finding Dlls
UtterAccess Discussion Forums > Microsoft® Access > Access Runtime, Packaging & Deployment
paulroy
Hi,
I have a custom DLL from a cash drawer manufacturer that I need to use to communicate with the drawer. It is my understanding that if I place the DLL in the same folder as my front end file then that should work and it does on my development machine, but when I install my application on another computer (customer) I get an error that the DLL cannot be found. I am using Access 2007 in either W7, Vista, XP. Can anyone provide any direction, thanks!
Paul
GroverParkGeorge
This is sort of obvious, but did you copy the dll to that other machine?
paulroy
Yes, it gets deployed by my installation script.
WildBird
Is it referenced in your app? Generally if it is a DLL, it needs to be referenced. Some may need to be registered as well before they work. You could check if you register the DLL (regsvr32 I think it is - google it, can do it from shortcut key if you set it up, or cmd line) Some installers do things differently, and unfortunately I dont have enough experience to offer much more advice..
paulroy
By reference I presume you mean this?
Private Declare Function GetDrawerHandle Lib "MSPOS_USB.dll" (ByVal DrawerNumber As Byte) As Long
The confusing part is that it works from from development computer.
Thanks.
AvgJoe
WildBird is referring to registering the dll.


AvgJoe
paulroy
Gotcha...
No for the following reasons:
-Microsoft documentation seems to suggest I don't need to if it's stored in the same folder as the .accdr.
-It won't register to begin with, I get an error that it can't find an entry point.
-It works on my computer without being registered (I scanned the registry and it won't come up).
Thanks.
AvgJoe
I'd then explore user Rights/Security Settings.


AvgJoe
paulroy
Some progress...
I have been saying it works on my computer but just discovered it doesn't. Here is what I did:

I moved my application from my development folder to another folder (deployment folder, all on the same computer) and placed the DLL in that folder also. I ran the application from the deployment folder and it worked. I then deleted the DLL from the deployment folder and it still worked??? I installed this amazing software (Process Viewer) and I am able to see all DLLs attached to Access and this tool tells me its reading the DLL from the development folder, WOW how is that happening? I then renamed the DLL in the development folder and it still worked. This time the DLL was being read from the Windows folder. I renamed that and finally the DLL could not be found. It makes sense to me for the DLL to be found in the Windows folder, but how can an application residing in my deployment folder link back to the development folder at runtime? Can anyone explain, can it be linked to the fact that it was complied in that folder? Having said all this, I am no further ahead when I deploy to a customer's computer. Since placing the DLL in the deployment folder doesn't seem to work (which appears to go against Microsoft documentation) should I place the DLL in the Windows folder (doesn't seem like a good idea to me)? Or perhaps include the drawer interface (which calls up the DLL) into an Access class and call LoadLibrary?
Thanks.
HiTechCoach
Check your references in the VBA editor. Make sure there is not a reference set to the DLL.

Here is an example that uses a DLL in the same manner you are trying: http://www.lebans.com/reporttopdf.htm
I would compare the code to yours to.
paulroy
I have gone the LoadLibrary way... seems to work... can anybody explain why it did not work by placing the DLL in the same folder as the accdr?
Thanks!
HiTechCoach
I have always used the LoadLibrary method. AFAIK you have to manually load it if it is not registered in Windows.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.