- 注册时间
 - 2010-8-21
 
- 最后登录
 - 2017-5-30
 
- 在线时间
 - 5 小时
 
 
 
 
 
编程入门 
  
	- 魔鬼币
 - 592 
 
 
 
 | 
 
主要用到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 );   
}   
 
 
 |   
 
 
 
 |