Thanks for the time you're putting in to helping me out. I'm not doing much error checking in the client, however I'm fairly sure LoadLibrary() isn't failing. Code is as follows:
Code:
using namespace std;
typedef char* (*version)();
int main(int argc, char *argv[])
{
version _version;
HINSTANCE hInst = LoadLibrary( "myFile.dll" );
if( hInst )
{
_version = (version)GetProcAddress( hInst, "version" );
if( _version )
{
cout << "Version: " << _version() << ::endl;
}
FreeLibrary( hInst ); ///< Free up DLL.
}
else
{
cout << "Fail" << ::endl;
}
::cin.get(); ///< Wait for user to hit return key before exiting.
return 0;
}
If LoadLibrary was failing, I'd have expected to have had "Fail" echo out, but it doesn't. If I debug the app and set a breakpoint on the "Fail" cout, it's never reached.