msvisual.com Forum Index
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Problem calling dll function with Visual Basic

 
Post new topic   Reply to topic    msvisual.com Forum Index -> VB Enterprise
Author Message
Rick



Joined: 04 Oct 2007
Posts: 3

PostPosted: Tue Aug 07, 2007 5:26 pm    Post subject: Problem calling dll function with Visual Basic Reply with quote

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.

Archived from group: microsoft>public>access>modulescoding
Back to top
View user's profile Send private message
Stefan Hoffmann



Joined: 04 Oct 2007
Posts: 2

PostPosted: Wed Aug 08, 2007 12:32 am    Post subject: Re: Problem calling dll function with Visual Basic Reply with quote

hi Rick,

Rick wrote:
> 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 <--
Back to top
View user's profile Send private message
little ole me



Joined: 04 Oct 2007
Posts: 1

PostPosted: Tue Aug 07, 2007 3:36 pm    Post subject: RE: Problem calling dll function with Visual Basic Reply with quote

Have you registered this dll (under references)?

"Rick" wrote:

> 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.
>
>
>
>
>
>
Back to top
View user's profile Send private message
Sinna



Joined: 04 Oct 2007
Posts: 191

PostPosted: Wed Aug 08, 2007 12:23 pm    Post subject: Re: Problem calling dll function with Visual Basic Reply with quote

little ole me wrote:
> Have you registered this dll (under references)?
>

This dll shouldn't be registered as it is a Windows DLL, not an ActiveX
DLL (seen the calling convention used).

Sinna
Back to top
View user's profile Send private message
Rick



Joined: 04 Oct 2007
Posts: 3

PostPosted: Thu Aug 09, 2007 2:07 pm    Post subject: Re: Problem calling dll function with Visual Basic Reply with quote

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


"Stefan Hoffmann" wrote in message @TK2MSFTNGP05.phx.gbl...
> hi Rick,
>
> Rick wrote:
>> 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 <--
Back to top
View user's profile Send private message
Arjan



Joined: 04 Oct 2007
Posts: 1

PostPosted: Thu Aug 09, 2007 11:26 am    Post subject: Re: Problem calling dll function with Visual Basic Reply with quote

Hi Rick,

You could try to place the DLL files that are being used (emdaz32.dll and
emlcns32.dll) in the same folder as the Access database/application is in and
reference the DLL without the complete path to it as you did before.

--Arjan

"Rick" wrote:

> 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
>
>
> "Stefan Hoffmann" wrote in message
> @TK2MSFTNGP05.phx.gbl...
> > hi Rick,
> >
> > Rick wrote:
> >> 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 <--
Back to top
View user's profile Send private message
Rick



Joined: 04 Oct 2007
Posts: 3

PostPosted: Thu Aug 09, 2007 4:43 pm    Post subject: Re: Problem calling dll function with Visual Basic Reply with quote

Thanks for the suggestion, but it made no difference.
With no full path provided it's attempting to access the dll files in the
"C:\Windows\System32 folder"

If I provide a full path for the first dll file referenced from my VB code I
can access it (if the folder is within my "Documents" folder) but the second
dll file which is called from the first is always going to be looked for in
the "C:\Windows\System32 folder"

Rick





"Arjan" wrote in message @microsoft.com...
> Hi Rick,
>
> You could try to place the DLL files that are being used (emdaz32.dll and
> emlcns32.dll) in the same folder as the Access database/application is in
> and
> reference the DLL without the complete path to it as you did before.
>
> --Arjan
>
> "Rick" wrote:
>
>> 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
>>
>>
>> "Stefan Hoffmann" wrote in message
>> @TK2MSFTNGP05.phx.gbl...
>> > hi Rick,
>> >
>> > Rick wrote:
>> >> 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 <--
>
Back to top
View user's profile Send private message
Stefan Hoffmann



Joined: 04 Oct 2007
Posts: 2

PostPosted: Thu Aug 09, 2007 11:19 pm    Post subject: Re: Problem calling dll function with Visual Basic Reply with quote

hi Rick,

Rick wrote:
> 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 <--
Back to top
View user's profile Send private message
DAVID



Joined: 04 Oct 2007
Posts: 1

PostPosted: Wed Aug 15, 2007 7:22 pm    Post subject: Re: Problem calling dll function with Visual Basic Reply with quote

> 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)


Rick wrote:
> 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.
>
>
>
>
>

Back to top
View user's profile Send private message
Display posts from previous:   
Related Topics:
Enum's in Visual Basic 5 and Visual Basic 6 I have Visual Basic 5 and I am trying to learn Visual Basic 6. I am reading "Visual Basic 6 Unleased Professiona lReference Edition" published by SAMS. This code does not compile. Away around this? Public Enum lbModeTypes [Text Only Mode] = [Image Mode] E

Differences between visual basic 5 and visual basic 6 I think I can buy Visiual Basic.net for $100 bucks but I don't want to spend that much money right now. I have a textbook on Visual Basic 6, but I only have Visual Basic 5. I took a course in Visual Basic 6 but one of the examples (The 'Find' routine in

visual basic i have a problem installing in my xp pc. it says it is looking for some system luigimagni

Visual Basic.NET I was looking for a newsgroups on VB.NET, is this the right section for me to ask questions or is there a better one? If you could please let me know or tell me where to go search for the proper newsgroup I would greatly appreciate it.

where to download visual basic .net Where could I download or buy (not a CD, but a downloadable file) on Internet? Thanks. P.S. If You know some sites, please sent the URL to
Post new topic   Reply to topic    msvisual.com Forum Index -> VB Enterprise All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group