Eric Sokolowsky
2004-01-16 16:25:11 UTC
I use mingw to compile an application that loads plugins with the Win32
API LoadLibrary() function. I create an installer program with
InnoSetup to be able to install the application on the user's hard
drive. I install the plugin .dll files in the same directory as the
executable and use a batch file to launch the executable. I noticed
that one particular plugin does not load on my laptop, which is running
Windows XP Home edition. However, the same plugin loads normally on my
Windows 2000 Professional desktop machine. On the laptop, the handle
returned from LoadLibrary() is 0, so I used the Win32 API function
SearchPath() to try to find the .dll. This function returns the proper
location for the .dll, but even if I pass in the full path returned from
SearchPath(), the LoadLibrary() function still returns 0 for the handle
to the .dll. Might there be another reason why this .dll is not able to
load? It's very strange because all of the other plugins in the same
directory are loadable on the laptop, and the same .dll is loadable on
the Windows 2000 desktop machine.
I called GetLastError() after the failed call to LoadLibrary() and it
said: "Error 487: Attempt to access invalid address." What does this
mean?
API LoadLibrary() function. I create an installer program with
InnoSetup to be able to install the application on the user's hard
drive. I install the plugin .dll files in the same directory as the
executable and use a batch file to launch the executable. I noticed
that one particular plugin does not load on my laptop, which is running
Windows XP Home edition. However, the same plugin loads normally on my
Windows 2000 Professional desktop machine. On the laptop, the handle
returned from LoadLibrary() is 0, so I used the Win32 API function
SearchPath() to try to find the .dll. This function returns the proper
location for the .dll, but even if I pass in the full path returned from
SearchPath(), the LoadLibrary() function still returns 0 for the handle
to the .dll. Might there be another reason why this .dll is not able to
load? It's very strange because all of the other plugins in the same
directory are loadable on the laptop, and the same .dll is loadable on
the Windows 2000 desktop machine.
I called GetLastError() after the failed call to LoadLibrary() and it
said: "Error 487: Attempt to access invalid address." What does this
mean?
--
____ __ Eric Sokolowsky (GST) NASA Goddard Space Flight Center
/ __/__/_/__ Visualization Programmer Scientific Visualization Studio
/ __/ _/ / _/ 301.286.3751 Mailstop 935.0 Bldg 28 Rm E102
/___/_//_/__/ ***@gsfc.nasa.gov Greenbelt, MD 20771
____ __ Eric Sokolowsky (GST) NASA Goddard Space Flight Center
/ __/__/_/__ Visualization Programmer Scientific Visualization Studio
/ __/ _/ / _/ 301.286.3751 Mailstop 935.0 Bldg 28 Rm E102
/___/_//_/__/ ***@gsfc.nasa.gov Greenbelt, MD 20771