// 下列 ifdef 块是创建使从 DLL 导出更简单的 // 宏的标准方法。此 DLL 中的所有文件都是用命令行上定义的 IRCONTROL_EXPORTS // 符号编译的。在使用此 DLL 的 // 任何其他项目上不应定义此符号。这样,源文件中包含此文件的任何其他项目都会将 // IRCONTROL_API 函数视为是从 DLL 导入的,而此 DLL 则将用此宏定义的 // 符号视为是被导出的。 #ifdef IRCONTROL_EXPORTS #define IRCONTROL_API __declspec(dllexport) #else #define IRCONTROL_API __declspec(dllimport) #endif #ifndef __MAKE_PYD__ // 是否使用PYD; extern "C" IRCONTROL_API int nIRControl; ////////////////////////////////////////////////////////////////////////// // 程序是否在运行; extern "C" IRCONTROL_API DWORD IsAppRunning(LPCTSTR lpszAppDir); // 启动红老鼠服务进程; extern "C" IRCONTROL_API bool StartIRApp(LPCTSTR lpszAppDir, LPCTSTR lpSignalXml, DWORD dwPort); // 关闭红老鼠; extern "C" IRCONTROL_API bool CloseApp(); ////////////////////////////////////////////////////////////////////////// extern "C" IRCONTROL_API bool Connect(LPCTSTR lpServer, int port); extern "C" IRCONTROL_API void DisConnect(); // 返回设备列表,以逗号隔开; extern "C" IRCONTROL_API LPCTSTR getDeviceNames(); // 获取信号数据集信号,以\n分隔; extern "C" IRCONTROL_API LPCTSTR getSignalsName(); // 加载xml文件; extern "C" IRCONTROL_API bool loadSignalDataSet(LPCTSTR lpDatasetXml); // 发送单个信号; extern "C" IRCONTROL_API bool sendSignal(LPCTSTR lpSignal, int send_times, int sleep_time); // 发送多个信号,以逗号分隔; extern "C" IRCONTROL_API bool sendSignals(LPCTSTR lpSignals, int sleep_time); // 发送重复信号; extern "C" IRCONTROL_API bool sendRepeatsSignal(LPCTSTR lpSignal, int repeat_time); #endif