My Assistant
![]() ![]() |
|
|
Sep 28 2011, 05:59 PM
Post
#1
|
|
|
UtterAccess Member Posts: 33 |
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 |
|
|
|
Sep 28 2011, 06:12 PM
Post
#2
|
|
|
UA Admin Posts: 19,233 From: Newcastle, WA |
This is sort of obvious, but did you copy the dll to that other machine?
|
|
|
|
Sep 28 2011, 09:04 PM
Post
#3
|
|
|
UtterAccess Member Posts: 33 |
Yes, it gets deployed by my installation script.
|
|
|
|
Sep 29 2011, 01:56 AM
Post
#4
|
|
|
UtterAccess VIP Posts: 3,050 From: Perth, Australia |
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..
|
|
|
|
Sep 29 2011, 07:54 AM
Post
#5
|
|
|
UtterAccess Member Posts: 33 |
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. |
|
|
|
Sep 29 2011, 09:39 AM
Post
#6
|
|
|
UtterAccess Ruler Posts: 2,042 From: West Coast, USA |
WildBird is referring to registering the dll.
AvgJoe |
|
|
|
Sep 29 2011, 10:13 AM
Post
#7
|
|
|
UtterAccess Member Posts: 33 |
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. |
|
|
|
Sep 29 2011, 10:15 AM
Post
#8
|
|
|
UtterAccess Ruler Posts: 2,042 From: West Coast, USA |
I'd then explore user Rights/Security Settings.
AvgJoe |
|
|
|
Sep 29 2011, 12:55 PM
Post
#9
|
|
|
UtterAccess Member Posts: 33 |
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. |
|
|
|
Sep 29 2011, 01:42 PM
Post
#10
|
|
|
UtterAccess VIP Posts: 18,396 From: Oklahoma City, Oklahoma |
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. |
|
|
|
Sep 30 2011, 08:24 AM
Post
#11
|
|
|
UtterAccess Member Posts: 33 |
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! |
|
|
|
Sep 30 2011, 09:13 AM
Post
#12
|
|
|
UtterAccess VIP Posts: 18,396 From: Oklahoma City, Oklahoma |
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! I have always used the LoadLibrary method. AFAIK you have to manually load it if it is not registered in Windows. |
|
|
|
![]() ![]() |
|
Go to Top · Lo-Fi Version | Time is now: 21st May 2013 - 05:22 AM |