LoadLibrary error
I have an x86 Win32 project that loads a DLL file using the
LoadLibrary command. (I'm using multi-byte, so it translates to
LoadLibraryA(), if that matters.)
On my development PC (VS2005) and another PC with VS2008 on it, this
program works great. When I move it to a different PC with no dev
environment, the LoadLibrary() call fails and GetLastError() returns
the code: 0x000036B1 "This application has failed to start because the
application configuration is incorrect. Reinstalling the application
may fix this problem. "
I've tried using debug versions and release versions of the code, both
yield the same result. The DLL file and the executable are in the same
directory.
Can anybody offer a suggestion as to what may be going wrong?
Thanks,
PaulH
If it helps, the exact code looks like this:
typedef std::basic_string< TCHAR, std::char_traits< TCHAR >,
std::allocator< TCHAR > > tstring;
const tstring& DriverDll = _T( "mydriver.dll" );
_hDriver = LoadLibrary( DriverDll.c_str() );
if( !_hDriver )
{
ATLTRACE( _T( "RST::Unable to locate driver: %s. Err:
%#08x.\n" ),
DriverDll.c_str(),
GetLastError() );
return FALSE;
}