MFC在release下输出信息到控制台(输出)

本文介绍了如何在MFC的Release模式下使用OutputDebugString函数输出信息到控制台。此函数将字符串发送给调试器显示,但需要调试器支持Unicode输出。在没有调试器的情况下,系统调试器会根据过滤器面具决定是否显示字符串。注意,从Windows Vista开始,系统调试器开始过滤内容。为了确保Unicode字符串正确显示,调试器需要调用WaitForDebugEventEx。建议应用程序提供控制调试输出的选项,并考虑使用事件追踪进行详细追踪。
摘要由CSDN通过智能技术生成

调用API: OutputDebugString

例如:

OutputDebugString(L"Hello I am just an example!\n");

以下搬运自msdn:https://msdn.microsoft.com/query/dev15.query?appId=Dev15IDEF1&l=ZH-CN&k=k(WINBASE%2FOutputDebugString);k(OutputDebugString);k(DevLang-C%2B%2B);k(TargetOS-Windows)&rd=true

OutputDebugString function

Sends a string to the debugger for display.

Important  In the past, the operating system did not output Unicode strings via OutputDebugStringW and instead only output ASCII strings. To force OutputDebugStringW to correctly output Unicode strings, debuggers are r

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值