Look:
I write codes in file DLL(name dll1.dll),
Code:
extern "C" _declspec(dllexport) int __stdcall ret()
{
return 100;
}
and then I want to use this function:
Code:
typedef int (__stdcall FUN)();
FUN *fun=NULL;
HMODULE hmod=LoadLibrary("dll1.dll");
if(NULL==hmod)
{
printf("error load\n");
return -1;
}
fun=(FUN*)GetProcAddress(hmod,"ret");
if(NULL==fun)
{
printf("error GetProcAddress:%d\n",GetLastError());
return -1;
}
but error number of function GetProcAddress is 127,
I want to know How to correct?