Re: Loadlibrary returns err.lastdellerror 127
- From: "Ralph" <nt_consulting64@xxxxxxxxx>
- Date: Mon, 10 Sep 2007 13:25:48 -0500
"Prescott" <pchartier@xxxxxxxxx> wrote in message
news:1189445418.566919.217710@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
<snipped>
Forget the "Fortran Version".
Use the "Win32 DLL" Version.
Forget registering the Dll.
Forget using LoadLibrary.
Forget capturing any bloody error messages except for the VB Error - which
is "... Not Found".
Delete all "play/test" code except a Declare Statement and a Call to Foo.
Declare Function foo Lib "MyDll.dll" ( ByRef StringArray() as String,
ByVal NumElements as Long)
Do make sure MyDll.dll is spelled correctly, and the Declare Statement is in
Scope from where you make the call to "foo".
Make sure you don't have any other "foo"s or extra "MyDll"s laying around
somewhere.
(Don't laugh, it has happened.)
If the Lib argument is declared with a full path, eg "C:\Junk\MyDll.dll"
then that path and that path alone is searched. If you don't use a full
path, then the search paths used. They are:
1) The folder the app is started-up in.
2) The current directory of the app (which may or may not be the same)
3) The Windows system directories C:\WINDOWS\SYSTEM and C:\WINDOWS\SYSTEM32
4) The Windows directory, C:\WINDOWS; or C:\WinNt; %SystemRoot%
5) The Folders listed in the PATH environmental variable.
It may not be MyDll that can not be found, it might be some component that
MyDll is dependent on that is missing in that environment. The search path
for dependent Dlls is EXACTLY the same as for the primary Dll.
If your VB App works in the IDE but when compiled it doesn't then it is
because something outlined above is different for the two environments (the
project vs. the wild).
Perhaps the Fortran runtime?
Anyway, don't go off on any other exotic adventures. The solution will be
found in the information above. <g>
-ralpth
.
- References:
- Loadlibrary returns err.lastdellerror 127
- From: Prescott
- Re: Loadlibrary returns err.lastdellerror 127
- From: Ralph
- Re: Loadlibrary returns err.lastdellerror 127
- From: Prescott
- Loadlibrary returns err.lastdellerror 127
- Prev by Date: Re: unmanaged use of IAudioEndpointVolume::SetMasterVolumeLevel
- Next by Date: Re: Loadlibrary returns err.lastdellerror 127
- Previous by thread: Re: Loadlibrary returns err.lastdellerror 127
- Next by thread: Re: Loadlibrary returns err.lastdellerror 127
- Index(es):
Relevant Pages
|