#pragma once #include #include #include #include //或者 #include #include #pragma comment(lib,"version.lib") #include #include #include using namespace std; namespace Global { ////////////////////////////////////////////////////////////////////////// // 全局变量; extern TCHAR g_szCurModuleDir[MAX_PATH]; extern TCHAR g_szCurModulePath[MAX_PATH]; extern TCHAR g_szFna[MAX_PATH]; extern TCHAR g_szConfig[MAX_PATH]; extern bool g_bEnableLog; extern TCHAR g_szLogPath[MAX_PATH]; extern time_t g_time; typedef struct _TLOG_{ string report_type; string report_data; }TLog, *pTLog; ////////////////////////////////////////////////////////////////////////// // 全局函数; void Init(); bool GetVersion(IN const TCHAR *fname, OUT WORD *pdwFileVersion, OUT WORD *pdwProductVerion); BOOL GetVersion(IN HMODULE hModule, OUT DWORD(&dwFVArray)[4], OUT DWORD(&dwPVArray)[4]); void WriteTextLog(const TCHAR *format, ...); void WritePythonLog(const TCHAR *format, ...); std::string EnCode_UTF8URL(IN const CHAR* pText); std::string &trim(std::string &str); // 字符串是否由数字、字母、符号组成; BOOL IsValidString(LPCTSTR lpszString); string DeCode_URLUNICODE(IN const CHAR* pURLText); };