
Originally Posted by
Igor Vartanov
Besides the name mangling issue, ain't you see an inconsistency in the declarations?
I don't know how i got that mixed up, but i changed it. But it's still not working.
Code:
typedef int (* testfunc)(int);
//in my main function
testfunc bla(0);
dllEngine = LoadLibrary ( L"test_engine.dll" );
if ( dllEngine == 0 )
MessageBoxW ( NULL, L"failed loading DLL", L"ERROR", MB_OK );
bla = (testfunc)GetProcAddress ( dllEngine, "testfunc" );
int x = bla(5);
The DLL file
Code:
extern int testfunc ( int x );
int testfunc (int x)
{
MessageBoxW ( NULL, L"test", L"blaat", MB_OK );
return x;
}