check my code snippet

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 (__stdcall * pICFUNC)(HWND);

pICFUNC MyFunction;
MyFunction = pICFUNC(lpfnGetProcessID);


HWND fWindow; // Window handle of the window you want to get

fWindow = FindWindow(NULL, L"Window_title"); // Find the window

///* The actual call to the function contained in the dll */
BOOL intMyReturnVal = MyFunction(fWindow);

/* Release the Dll */
FreeLibrary(hGetProcIDDLL);
return 0;
}

//////////////////////////////////////////////////////////////////////////////
//and in the App.cpp
///////////////////////////////////////////////////////////////
__declspec(dllexport) void runAppli(HWND hwnd)

{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
thisDLL->m_pMainWnd->ShowWindow(SW_SHOW);
}


My application is launching but crashing immediately. Please tell me what should I do ? Please help me someone. Thanks Sujan