Hello All,

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,
EXPORT void DllFunc(void)
	FnPtrT FnPtr = (FnPtrT)GetProcAddress(GetModuleHandle(NULL), "ExeFunc");
	DWORD dw = GetLastError();
		(*FnPtr)("Messge From The DLL");
		MessageBox(NULL,"Not work :(","From DLL",MB_OK);
I am getting handle to the exe file....but GetProcAddress is failing and returning NULL.

In Exe function, i have declared Exefunc as:
extern "C"
	EXPORT void ExeFunc(char * lpszMessage)
		MessageBox(NULL,lpszMessage,"From ExeFunc",MB_OK);
Any information regarding this will help.

Naveen Anand

Last edited by shabbir; 13Nov2006 at 10:28.. Reason: Code formating.