Original Post
I''m doing a dll on my pocketpc and it fails when I try to get a function pointer from it.
I have this in the dll code:
__declspec (dllexport) void InitFunc (void);
void InitFunc (void)
{
...
}
And this is how I load the dll in the main program:
HINSTANCE hDll;
FARPROC dllInitFunc;
void LoadLib (void)
{
DWORD err;
hDll=LoadLibrary(L"mylib.dll");
if (hDll==NULL){
MessageBox(hWnd,L"Failed to load dll",L"Error",MB_OK);
return;
}
dllInitFunc=GetProcAddress(hVibradll,L"InitFunc");
if (dllInitFunc==NULL){
err=GetLastError();
MessageBox(hWnd,L"Failed to get proc address",L"Error",MB_OK);
}
}
dllInitFunc becomes NULL and err is 87, ERROR_INVALID_PARAMETER.
What am I doing wrong?