I'm trying to call a function in a dll. I created this dll myself too. When i run my code i get am 'Exception unhandled' error. Can someone please tell me what i'm doing wrong?
In my exe file i basically do this:
This is the relevant code in my dllCode:typedef int (__stdcall * voidFunc)(int); //in my main function dllEngine = LoadLibrary ( L"test_engine.dll" ); if ( dllEngine == 0 ) MessageBoxW ( NULL, L"failed loading DLL", L"ERROR", MB_OK ); testfunc = (voidFunc)GetProcAddress ( dllEngine, "testfunc" ); int x = testfunc(5);
Code:extern int testfunc ( int x ); int testfunc (int x) { MessageBoxW ( NULL, L"test", L"blaat", MB_OK ); return x; }




Reply With Quote