|
I am able to reduce the code to this much but still its crashing...
/////////////////////////////////////////////////////////////////////////////////////
int main(int argc, char **argv)
{
/* get handle to dll */
HINSTANCE hGetProcIDDLL = LoadLibrary(TEXT("C:\\Users\\DasmahapatraS\\Projec ts\\Bhagavan_Cadem\\RevolutionProj\\debug\\Revolut ionProj.dll"));
/* get pointer to the function in the dll*/
FARPROC lpfnGetProcessID = GetProcAddress(HMODULE (hGetProcIDDLL),"runAppli");
/*
Define the Function in the DLL for reuse. This is just prototyping the dll's function.
A mock of it. Use "stdcall" for maximum compatibility.
*/
typedef BOOL (* pICFUNC)(HINSTANCE, LPCSTR);
pICFUNC MyFunction=NULL;
///* The actual call to the function contained in the dll */
BOOL intMyReturnVal = MyFunction(HMODULE (hGetProcIDDLL), "runAppli");
/* Release the Dll */
FreeLibrary(hGetProcIDDLL);
return 0;
}
/////////////////////////////////////////////////////////////////////////////////////
__declspec(dllexport) void runAppli()
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
}
////////////////////////////////////////////////////////////////////////////////////
|