Calling a view from the frame class
I have an app that posts mesages with HWND_BROADCAST. The documentation says that "The message is posted to all top-level windows in the system, including disabled or invisible unowned windows, overlapped windows, and pop-up windows. The message is not posted to child windows."
The problem is that I have an MDI app, so I get the message in my MainFarame class and need to call the method in my view class to process the action. How do I call the method? I have a pointer to the document class.
Re: Calling a view from the frame class
I tried the following code:
void CMainFrame::OnSystemAlert()
{
CWindowsProcessView* p = (CWindowsProcessView*)AfxGetMainWnd();
p->InsertAlert(1);
p->SendMessage(WM_COMMAND,0,0);
}
It compiles but gives me an exception breakpoint.
Re: Calling a view from the frame class
I tried the following code:
void CMainFrame::OnSystemAlert()
{
CWindowsProcessView* p = (CWindowsProcessView*)AfxGetMainWnd();
p->InsertAlert(1);
}
It compiles but gives me an exception breakpoint.