CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 1999
    Posts
    76

    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.


  2. #2
    Join Date
    Apr 1999
    Posts
    76

    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.




  3. #3
    Join Date
    Apr 1999
    Posts
    76

    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.



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured