CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: Post Message

  1. #1
    Guest

    Post Message

    A CDialog class displays (a report) in a CFrameView window.
    I am trying to display a messagebox when the user closes the FrameView, by posting a message to the dialog


    pwnd->PostMessage(WM_U_CLOSE_REPORT); // user defined message




    and trapping the message in the dialog (and then showing the messagebox)


    BEGIN_MESSAGE_MAP(CRptSiCheckRegister, CToolDlg)
    //{{AFX_MSG_MAP(CRptSiCheckRegister)
    //}}AFX_MSG_MAP
    ON_MESSAGE(WM_U_CLOSE_REPORT, OnCloseReport)
    END_MESSAGE_MAP()




    This is supposed to stop the messgebox from displaying over the top of the FrameView.
    I need the Dialog to produce the messagebox and NOT the FrameView.

    The above WORKS perfectly in DEBUG mode, but throws a MFC42.DLL exception at run time in RELEASE mode.

    Any ideas on either the fix - or a workaround.

    Thanks,
    Ian
    [email protected]


  2. #2
    Guest

    Re: Post Message

    Check out article Q195032 about Incorrect Function Signatures.


  3. #3
    Guest

    Re: Post Message

    Don't forget that all Message handler functions need to have a WParam and LParam as parameters!


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