OutputDebugString小例子
2012-09-13 14:12
253 查看
不常使用OutputDebugString,记录分享下。
//==============================================================================
#include <windows.h>
#include <stdio.h>
int main(int argc, char** argv)
{
LPCWSTR strShow = L"OutputDebugString sample 1\n\tOutputDebugString sample 2\n";
OutputDebugString(strShow);
wchar_t buf[100];
int bye = 88;
int len = swprintf(buf, 100, L"%s and %d\n", L"Hello world", bye);
printf( "wrote %d characters\n", len );
OutputDebugString(buf);
getchar();
return 0;
}
/*
Console print:
wrote 19 characters
VS Output print:
OutputDebugString sample 1
OutputDebugString sample 2
Hello world and 88
*/
//==============================================================================
#include <windows.h>
#include <stdio.h>
int main(int argc, char** argv)
{
LPCWSTR strShow = L"OutputDebugString sample 1\n\tOutputDebugString sample 2\n";
OutputDebugString(strShow);
wchar_t buf[100];
int bye = 88;
int len = swprintf(buf, 100, L"%s and %d\n", L"Hello world", bye);
printf( "wrote %d characters\n", len );
OutputDebugString(buf);
getchar();
return 0;
}
/*
Console print:
wrote 19 characters
VS Output print:
OutputDebugString sample 1
OutputDebugString sample 2
Hello world and 88
*/
相关文章推荐
- 多个生产者-一个消费者-进程间同步的例子 - OutputDebugString的实现
- Debug监视器(监视运行期程序通过API函数OutputDebugString输出的字符串)
- vs输出框用OutputDebugString输出不了log了
- 使用OutputDebugString帮助调试
- OutputDebugString
- Windows日志打印API的封装使用OutputDebugStringA
- OutputDebugString输出调试信息
- tip : 运行x64程序时, 用debugview收不到X64程序里OutputDebugString打印出的信息
- 理解 Win32 "OutputDebugString"
- 调试输出信息OutPutDebugString
- OutputDebugString输出调试信息
- Windows下调试信息 TRACE OutputDebugString
- OutputDebugString的原理及模拟源码
- debugger显示内容函数 [VOID OutputDebugString]
- 在程序中访问OutputDebugString的信息
- 包装outputdebugstring使其支持变参
- debugview + outputdebugstring 调试程序 同时也可以输出调试日志文件
- OutputDebugString在win7操作系统windbg内核调试下无法输出的解决办法
- OutputDebugString.txt
- Windows下Debug模式的检测和OutputDebugString