⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 errorlog.h

📁 socket代理的C++源码,实现了代理服务器的大部分功能
💻 H
字号:
#pragma once

class CErrorLog
{
public:
	static CErrorLog* Instance();
	static void Release();

	//WIN32 API错误、DLL函数返回错误值、COM错误
	static int m_nApiErr;
	static int m_nComErr;
	static int m_nDllErr;

	//将错误写入日志文件函数
	void WriteErrLogStr(const CString& strClass,
		const CString& strFunc,
		const CString& strError);
	void WriteErrLogNum(const CString& strClass,
		const CString& strFunc,
		unsigned int unError);
	//将SDK错误代码(WIN32 API错误、DLL函数返回错误值、COM错误)写入
	//全局变量g_nApiErr、g_nComErr、g_nDllErr
	void SetSdkError(int nApiError = 0, int nComError = S_OK, int nDllError = 0);
	//级联错误号:如果子函数返回0xE,则将父函数的错误号0xF添加在子函数
	//错误号之上:0xFE,0xFE用来返回给上一级函数,如果级联层数超过8层,
	//则子函数的错误号不变(即父函数的错误号被忽略)
	unsigned int AddError(unsigned int unErrorF, unsigned int unErrorS);

private:

	CErrorLog(void);
	~CErrorLog(void);

	//获得当前执行文件的文件名称和路径
	CString GetExePath(HMODULE hModule = NULL, 
		CString *pstrPath = NULL, 
		CString *pstrFile = NULL);

	//检查文件或目录是否存在,如果存在返回真,不存在或者出错返回假
	//如果blnCheckDir为真,则检查是否为目录,如果不是或者不存在都返回假,是则返回真
	bool CheckFileIfExist(const CString& strFile, bool blnCheckDir = false);

protected:

	static CErrorLog* m_pInstance;
};

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -