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

    AfxMessageBox not comming up in MFC dialog based application.

    Hi there,

    Thanks a lot if you could help me in this problem.

    I have created a dialog based application using MFC wizard. Every thing works well. But the problem is inside OnOk member function i am trying to show a AfxMessageBox. but when i run the application the message box is not comming up in the screen. I even tried with ::MessageBox() function even then it didn't work.

    Thanks
    Bye.


  2. #2
    Join Date
    Jul 1999
    Location
    Moscow, Russia
    Posts
    667

    Re: AfxMessageBox not comming up in MFC dialog based application.

    Hi,
    Maybe you try to call AfxMessageBox after CDialog::OnOK();?
    If so,try this:

    void CYourDlg::OnOK()
    {
    AfxMessageBox("It's me",MB_OK);
    CDialog::OnOK();

    }



    Let me know if it helps,

    Good luck,
    Oleg.


  3. #3
    Join Date
    Aug 1999
    Posts
    11

    Re: AfxMessageBox not comming up in MFC dialog based application.

    Thanks Oleg.

    It worked. I had kept the CDialog::OnOK(); at the begining because the there are few edit boxes in the dialog box and the data was not getting transfered on the repective CString member variable.

    But now i am calling UpdateData(TRUE);

    This worked
    Thanks a lot
    bye.


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