- 注册时间
 - 2021-4-16
 
- 最后登录
 - 2024-3-8
 
- 在线时间
 - 3 小时
 
 
 
 
 
编程入门 
  
	- 龙马币
 - 106 
 
 
 
 
 | 
 
 
主要用到OutputDebugString函数,直接看代码。 
 
Debug_Trace.h 
 
- #if !defined(DEBUG_TRACE_INCLUDE_)  
 
 - #define  DEBUG_TRACE_INCLUDE_  
 
 -   
 
 - #include <stdio.h>  
 
 - #include <wTypes.h>  
 
 - #include <tchar.h>   
 
 -   
 
 - void    Debug_TraceA(char* fmt, ...);  
 
 - void    Debug_TraceW(WCHAR* fmt, ...);  
 
 -   
 
 - #endif  
 
  复制代码 
 
 
 
Debug_Trace.cpp 
 
- #include "Debug_Trace.h"  
 
 -   
 
 - void Debug_TraceA(char* fmt, ...)  
 
 - {  
 
 -     char buf[32*1024]   = {0};  
 
 -     va_list args;  
 
 -     va_start( args, fmt );  
 
 -     vsprintf( buf, fmt, args );  
 
 -     va_end( args );  
 
 -     OutputDebugStringA( buf );  
 
 - }  
 
  
 
- void Debug_TraceW(WCHAR* fmt, ...)  
 
 - {  
 
 -     WCHAR buf[1024] = {0};  
 
 -     va_list args;  
 
 -     va_start( args, fmt );  
 
 -     vswprintf( buf, fmt, args );  
 
 -     va_end( args );  
 
 -     OutputDebugStringW( buf );  
 
 - }  
 
  复制代码 |   
 
 
 
 |