Display the C ++ debugging information in the vs output window and call it like a trace.

Source: Internet
Author: User

We know that MFC can call macro trace and other very convenient output debugging information to the Visual Studio output window, but there is no human-like function in C ++. Recently I am developing a smallProgramWe tracked the trace macro of MFC and found that it is mapped to the atltrace macro in atltrace. H. for some reasons, we also want to use trace in C ++ as follows:

# Include <atltrace. h>
# Define trace atltrace

Trace ("");

In C ++, you can directly use the following functions:

Outputdebugstring Function

 

Sends a string to the debugger for display.

 

Syntaxvoid winapi outputdebugstring (_ in_opt lpctstrLpoutputstring); Parameters

Lpoutputstring

The null-terminated string to be displayed.

Return Value

This function does not return a value.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.