From Exe function, I am able to call MFC function by loading dll. Now, I need to call a exe function, from dll. For that, I am using following code:
In Dll file,
Code:
EXPORT void DllFunc(void)
{
FnPtrT FnPtr = (FnPtrT)GetProcAddress(GetModuleHandle(NULL), "ExeFunc");
DWORD dw = GetLastError();
if(FnPtr)
(*FnPtr)("Messge From The DLL");
else
MessageBox(NULL,"Not work :(","From DLL",MB_OK);
}
In Exe function, i have declared Exefunc as:
Code:
extern "C"
{
EXPORT void ExeFunc(char * lpszMessage)
{
MessageBox(NULL,lpszMessage,"From ExeFunc",MB_OK);
}
}
Regards,
Naveen Anand
