#include <afx.h>
#include <shellapi.h>
class LOG
{
public:
LOG();
virtual ~LOG();
public:
static CString GetLogFile();
static short SetLogFile(LPCTSTR strPath);
static short ViewLogFile();
static short SetPrefix(LPCTSTR strPrefix);
static CString sOutV(LPCTSTR strType, LPCTSTR strFormat = NULL, va_list valist = NULL);
static CString sOut0(LPCTSTR strType, LPCTSTR strFormat = NULL,...);
static CString sOut ( LPCTSTR strFormat = NULL,...);
static short OutV(LPCTSTR strType, LPCTSTR strFormat = NULL, va_list valist = NULL);
static short Out0(LPCTSTR strType, LPCTSTR strFormat = NULL,...);
static short Out (LPCTSTR strFormat = NULL,...);
protected:
static CString s_strLogFile;
static CString s_strLogPrefix;
static HANDLE s_hWriteEvent;
};
//
#include "LogTrace.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
// 得到可执行程序所在目录
// BOOL bIncludeSep -- 是否包含最后的分隔符"/"
CString GetExePath(BOOL bIncludeSep)
{
// 得到当前的文件名
CString strFileName;
GetModuleFileName(Ge