#pragma once #include #include #include //#include //或者 #include #include #include #pragma comment(lib,"version.lib") #include #include // GDI+ #include using namespace Gdiplus; #pragma comment(lib, "gdiplus.lib") #ifndef _UNICODE typedef string TString; #else typedef wstring TString; #endif ////////////////////////////////////////////////////////////////////////// // dll相关; extern HMODULE g_hdll; extern BOOL LoadLogLibarary(); extern void FreeLogLibarary(); typedef DWORD(*irc_IsAppRunning)(LPCTSTR lpszAppDir); typedef bool (*irc_StartIRApp)(LPCTSTR lpszAppDir, LPCTSTR lpSignalXml, DWORD dwPort); typedef bool (*irc_CloseApp)(); typedef bool (*irc_Connect)(LPCTSTR lpServer, int port); typedef void (*irc_DisConnect)(); typedef bool (*irc_loadSignalDataSet)(LPCTSTR lpDatasetXml); typedef LPCTSTR(*irc_getDeviceNames)(); typedef LPCTSTR(*irc_getSignalsName)(); typedef bool (*irc_sendSignal)(LPCTSTR lpSignal, int send_times, int sleep_time); typedef bool (*irc_sendSignals)(LPCTSTR lpSignals, int sleep_time); typedef bool (*irc_sendRepeatsSignal)(LPCTSTR lpSignal, int repeat_time); extern int g_nIRControl; extern irc_IsAppRunning g_IsAppRunning; extern irc_StartIRApp g_StartIRApp; extern irc_CloseApp g_CloseApp; extern irc_Connect g_Connect; extern irc_DisConnect g_DisConnect; extern irc_getDeviceNames g_getDeviceNames; extern irc_getSignalsName g_getSignalsName; extern irc_loadSignalDataSet g_loadSignalDataSet; extern irc_sendSignal g_sendSignal; extern irc_sendSignals g_sendSignals; extern irc_sendRepeatsSignal g_sendRepeatsSignal; ////////////////////////////////////////////////////////////////////////// namespace Global { typedef struct __ST_CONFIG__ { std::string redratpath; bool bGenerics; std::string signaldir; std::string use_signal; }STConfig, * pSTConfig; ////////////////////////////////////////////////////////////////////////// // 全局变量; 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 STConfig g_Config; ////////////////////////////////////////////////////////////////////////// // 全局函数; void GetConfig(); int ReadReg(char* path, char* key, char* value); void WriteTextLog(const TCHAR* format, ...); BOOL LoadImgFromFile(IN Image** pImg, LPCTSTR lpPath); BOOL LoadImgFromBuffer(IN Image** pImg, IN BYTE* pBuffer, IN CONST INT& nBufLen); BOOL LoadImgFromBuffer(IN Image** pImg, LPCTSTR lpPath); int GetEncoderClsid(IN CONST WCHAR* format, OUT CLSID* pClsid); Image* LoadImgFromResource(IN HMODULE hModule, IN LPCTSTR lpName, IN LPCTSTR lpType); BOOL SaveImgByRotate(LPCTSTR lpszFileName, BYTE* pBuffer, CONST INT& nBufLen, BOOL bHoriontal, BOOL bVertically); void MKDIR(LPCTSTR dir); bool GetVersion(OUT WORD* pdwFileVersion, OUT WORD* pdwProductVerion); };