
Calling a function defined in the View Class
You could send a userdefined message to the mainwindow.
void CSplashWnd::HideSplashScreen()
{
....
AfxGetMainWnd()->SendMessage(WM_APP+1,0,0);
....
Quote:
}
//
// Now add a handler for the message in mainfrm.cpp/mainfrm.h
//
// Insert the following line just before DECLARE_MESSAGE_MAP() in the
// CMainFrame class.
LRESULT OnMyMessage(WPARAM wp, LPARAM lp);
// Add function body to mainfrm.cpp
LRESULT CMainFrame::OnMyMessage(WPARAM, LPARAM)
{
//
// Youy code goes here
//
return 0;
Quote:
}
David John Evans skrev i meddelelsen ...
Quote:
>Hi,
>I have written an SDI application and want to call a function (in the View)
>immediately after the splash screen has been destroyed.
>That is, in the splash code:
>void CSplashWnd::HideSplashScreen()
>{
> CWnd* pMainWnd = AfxGetMainWnd();
> DestroyWindow();
>// I want to call a function in the View here.
> pMainWnd->UpdateWindow();
>}
>Does anybody know how to do this?
>Thanks
>DAVE