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

    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,635

    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
    Join Date
    Feb 2003
    Location
    Iasi - Romania
    Posts
    8,234

    Re: Debug-only AfxMessageBox

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

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