visual studio - Open a dll (get handle) in c++ -
i'm looking load dll library in c++, visual studio.
when error code 193, is: error_bad_exe_format 193 (0xc1) %1 not valid win32 application.
the code below
using namespace std; int main(){ hinstance dllhandle = loadlibrary(l"c:\\lkg5000_dll_ver1_10\\english\\64bit\\lkif2.dll"); cout << dllhandle << endl; if (dllhandle != 0) { cout << "created handle" << endl; } else { cout << ":(" << endl; } cout << getlasterror() << endl; getchar(); //lazy way keep cmd window open return 0; }
any suggestions? thanks
given dll path looks it's 64-bit (win64) dll.
make sure program trying load dll compiled 64-bit target well. can't load 64-bit dll in 32-bit application or other way around.
read here more details.
Comments
Post a Comment