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

Thread: Debug-only AfxMessageBox

  1. #1
    Join Date
    Nov 2010
    Posts
    52

    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
    Location
    Florida
    Posts
    12,232

    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
    Location
    Iasi - Romania
    Posts
    8,060

    Re: Debug-only AfxMessageBox

    Use ASSERT macro, followed by a comment describing the error.
    Ovidiu Cucu
    "When in Rome, do as Romans do."
    My likes on StumbleUpon
    Visit: Microsoft Virtual Academy
    Follow: https://twitter.com/#!/ovidiucucu
    My blog: http://codexpert.ro/blog/author/ovidiu-cucu/

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 CodeGuru survey question.


Featured


HTML5 Development Center