Debug-only AfxMessageBox
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums
Results 1 to 3 of 3

Thread: Debug-only AfxMessageBox

  1. #1
    Join Date
    Nov 2010

    Debug-only AfxMessageBox

    Hi, I am looking for a function like AfxMessageBox, but will only available in Debug Version, to display some error messages. I have thought of TRACE, but it will only dump the error message in the output box, not pop up a messagebox to pause the execution of the program. Does Visual C++ provide such a function?

  2. #2
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003

    Re: Debug-only AfxMessageBox

    You could wrap your call to AfxMessageBox() #ifdef _DEBUG, but that's an unusual way to debug. What's that doing that the debugger can't accomplish?

  3. #3
    ovidiucucu's Avatar
    ovidiucucu is offline Moderator/Reviewer Power Poster
    Join Date
    Feb 2003
    Iasi - Romania

    Re: Debug-only AfxMessageBox

    Use ASSERT macro, followed by a comment describing the error.
    Ovidiu Cucu
    "When in Rome, do as Romans do."
    My latest articles:

Posting Permissions

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

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

This is a survey!

HTML5 Development Center