Click to See Complete Forum and Search --> : Calling a view from the frame class


Dallex
August 13th, 1999, 12:37 PM
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.

Dallex
August 13th, 1999, 01:44 PM
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.

Dallex
August 13th, 1999, 02:01 PM
I tried the following code:

void CMainFrame::OnSystemAlert()
{
CWindowsProcessView* p = (CWindowsProcessView*)AfxGetMainWnd();
p->InsertAlert(1);

}




It compiles but gives me an exception breakpoint.