Problem calling dll function with Visual Basic

R

Rick

I'm using Access Visual Basic.
When trying to call this function within its class module:
Declare Function DAZOptions Lib "emdaz32.dll" (ByVal lngHandle As Long)
As Long

I receive the following error:
Run time error '53':
File not found: emdaz32.dll

My code and this function worked perfectly with Windows XP but now fails
after upgrading to Windows Vista 64-bit.

The file emdaz32.dll IS contained in the folder C:\Windows\System32\.

Even if I declare the function using the full path to the dll file as shown
below:
Declare Function DAZOptions Lib " C:\Windows\System32\emdaz32.dll"
(ByVal lngHandle As Long) As Long

I still receive the same error message just showing the full path:
Run time error '53':
File not found: C:\Windows\System32\emdaz32.dll

I don't understand why "File not found" error is returned when the file is
there.
Is there something different I have to do to call a 32-bit dll when using
Windows Vista 64-bit version? My other 32-bit applications are working
properly.

I will GREATLY appreciate any assistance anyone can offer. This has me
really stumped and frustrated.
 
S

Stefan Hoffmann

hi Rick,
The file emdaz32.dll IS contained in the folder C:\Windows\System32\.
How did you install it in this folder? Maybe you are running in on of
the security measures of Vista.

Try moving the dll to a folder where you have full access, e.g.
%USERPROFILE%.


mfG
--> stefan <--
 
S

Sinna

little said:
Have you registered this dll (under references)?
<snip>
This dll shouldn't be registered as it is a Windows DLL, not an ActiveX
DLL (seen the calling convention used).

Sinna
 
R

Rick

Stefan,

I think that is indeed my problem. I moved the dll file to a "Temp" folder
inside my "Documents" folder and changed the Declaration as follows:
Declare Function DAZOptions Lib "
C:\Users\Rick\Documents\Temp\emdaz32.dll" (ByVal lngHandle As Long) As Long

I no longer get the error message that THIS dll can't be found, however, I
get an error message that emlcns32.dll can't be found. This is a dll which
is called from within the emdaz32.dll and there's no reference to it in my
VB code. The emlcns32.dll file is contained both within my new "Temp"
folder along with the emdaz32.dll and in the "C:\Windows\System32" folder.

Apparently I'm going to have to give this Access project permission to
access the "C:\Windows\System32" folder where all the 32-bit system dll
files are normally located.

Does anyone have an idea how to accomplish this?

Thanks so much for your help?

Rick
 
S

Stefan Hoffmann

hi Rick,
I no longer get the error message that THIS dll can't be found, however,
I get an error message that emlcns32.dll can't be found. This is a dll
which is called from within the emdaz32.dll and there's no reference to
it in my VB code. The emlcns32.dll file is contained both within my new
"Temp" folder along with the emdaz32.dll and in the
"C:\Windows\System32" folder.
Then there is a hardcoded path in this DLL, which I would consider a bug.
Apparently I'm going to have to give this Access project permission to
access the "C:\Windows\System32" folder where all the 32-bit system dll
files are normally located.
I'm not sure whether you're DLLs run in the Virtual Store or not. This
may be a problem.

But you may give ProcessMonitor/ProcessExplorer a chance.


mfG
--> stefan <--
 
D

DAVID

The file emdaz32.dll IS contained in the
folder C:\Windows\System32\.

Are you sure? Windows Vista has the power to
emulate the system32 folder, so that 32 bit
programs which think they need to write to
that folder can do so. Of course, other people
who look in that folder won't see any changes.

(david)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top