#ifndef _HOTCOMM_INTERFACE_H #define _HOTCOMM_INTERFACE_H
#if defined(INCLUDE_AFTER_WINDOWS_H) && !defined(_INC_WINDOWS) #error This header must be included before utility.h and formatio.h #error because it includes cviauto.h which includes Windows SDK headers. #endif /* INCLUDE_AFTER_WINDOWS_H */
#include "common.h"
enum HOTCOMM_BINDCTRLCOMMANDEnum { HOTCOMM_SYSTEM_COMMAND_PASSWORD = 1,//设置密码,控件与串口无关 HOTCOMM_COMMPORT_COMMAND_PASSWORD = 2,//设置密码,控件与串口有关 HOTCOMM_SYSTEM_COMMAND_CLEARTEXTBOX = 3,//清空文本框, 控件与串口无关 HOTCOMM_COMMPORT_COMMAND_CLEARTEXTBOX = 4, //清空文本框, 控件与串口无关 HOTCOMM_SYSTEM_COMMAND_POWERBUTTON = 9, //控件与串口有关 HOTCOMM_COMMPORT_COMMAND_PUSHBUTTON = 10, //控件与串口有关 HOTCOMM_SYSTEM_COMMAND_TRAYICON = 9999,//安装托盘图标 }; /*-------------------------------------------------------------------------------------------- HotComm将应用COM接口技术实现对控件的动态(静态)绑定 --------------------------------------------------------------------------------------------*/
#define HotComm_BindCtrl_MaxCount 250//
//HotComm的类COM接口
typedef struct { unsigned int CommPort; //串口号 int Panel; //面板 int Control; //控件 int Attribute; //属性 int AttributeValue; //属性值 int Command; //执行命令 int Event; //事件 char *Message; //消息 char *Buffer; //备用 }HotComm_BindCtrlArrayStruct, *HotComm_BindCtrlArrayStructPtr;
typedef int (CVICALLBACK *HotComm_BindCtrlCallbackPtr) (int Panel, int Control, int Event, void *BindCtrlStructPtr, int EventData1, int EventData2);
typedef struct {//注意BindCtrlArray[HotComm_BindCtrl_MaxCount - 1]被系统占用!!! HotComm_BindCtrlArrayStruct BindCtrlArray[HotComm_BindCtrl_MaxCount];//通用绑定接口结构 数组 HotComm_BindCtrlCallbackPtr BindCtrlCallBackFunction;//通用回调函数 HotComm_BindCtrlArrayStructPtr BindCtrlCallBackData;//通用回调数据(在EVENT_RIGHT_DOUBLE_CLICK时**动态绑定控件) int BindCount;//实际绑定个数 int BindMaxCount;//最大绑定个数 }HotComm_BindCtrlStruct;
typedef interface IHotComm_BindCtrl IHotComm_BindCtrl;
interface IHotComm_BindCtrl { CONST_VTBL struct IHotComm_BindCtrlVtbl *lpVtbl; HotComm_BindCtrlStruct *HotComm_BindCtrlPtr; };
//HotComm的类COM接口的控件绑定类接口 //typedef interface IHotComm_BindCtrl IHotComm_BindCtrl; typedef struct IHotComm_BindCtrlVtbl { BEGIN_INTERFACE //1. 通用绑定接口结构参数测试函数 HRESULT (STDMETHODCALLTYPE __RPC_FAR *GetBindCtrlCount)(int Panel, int Control, int * Count, int * MaxCount); //2. 通用绑定接口结构数组参数测试函数 HRESULT (STDMETHODCALLTYPE __RPC_FAR *GetBindCtrlVal)(HotComm_BindCtrlArrayStruct *BindCtrlStructPtr, unsigned int *CommPort, int *Panel, int *Control, int *Attribute, int *AttributeValue, int *Command, int *Event, char *Message, char *Buffer); //3. 通用绑定接口结构数组参数设置函数 HRESULT (STDMETHODCALLTYPE __RPC_FAR *SetBindCtrlVal)(HotComm_BindCtrlArrayStruct *BindCtrlStructPtr, unsigned int CommPort, int Panel, int Control, int Attribute, int AttributeValue, int Command, int Event, char *Message, char *Buffer); //4. 通用取结构指针函数 HotComm_BindCtrlArrayStructPtr (STDMETHODCALLTYPE __RPC_FAR *GetBindCtrlStructPtr)(int Panel, int Control);
//5. 创建绑定 HRESULT (STDMETHODCALLTYPE __RPC_FAR *CreatBindCtrlVal)(unsigned int CommPort, int Panel, int Control, int Attribute, int AttributeValue, int Command, int Event, char *Message, char *Buffer); //6. 在打开串口后才开始绑定 HRESULT (STDMETHODCALLTYPE __RPC_FAR *BindCtrlCommPortPassword)(unsigned int CommPort, int Panel, int Control, const char *Password, const char *NewPassword);
//7. 常绑定 HRESULT (STDMETHODCALLTYPE __RPC_FAR *BindCtrlSystemPassword)(int Panel, int Control, const char *Password, const char *NewPassword);
//8. 在打开串口后才开始绑定 HRESULT (STDMETHODCALLTYPE __RPC_FAR *BindCtrlCommPortClearTextBox)(unsigned int CommPort, int CommandPanel, int CommandControl, int TextPanel, int TextControl); //9. 常绑定 HRESULT (STDMETHODCALLTYPE __RPC_FAR *BindCtrlSystemClearTextBox)(int CommandPanel, int CommandControl, int TextPanel, int TextControl); //10. 在打开串口后才开始绑定 HRESULT (STDMETHODCALLTYPE __RPC_FAR *BindCtrlCommPortPushButton)(unsigned int CommPort, int CommandPanel, int CommandControl, int LedPanel, int LedControl, int LedInverseint, int Escape); //11. 常绑定系统托盘 HRESULT (STDMETHODCALLTYPE __RPC_FAR *BindCtrlSystemTrayIcon)(int MainPanel, int Panel, int Control, const char *TrayCaption, const char *ShowIconFileName, const char *HideIconFileName); //12. 绑定垂直滚动条 HRESULT (STDMETHODCALLTYPE __RPC_FAR *BindCtrlVscrollBar)(int CommPort, int Panel, int Control);//绑定垂直滚动条
//13. 绑定OPEN开关 HRESULT (STDMETHODCALLTYPE __RPC_FAR *BindCtrlSystemPowerButton) (int Panel, int Control, int LedPanel, int LedControl, void *HookFunction); END_INTERFACE } IHotComm_BindCtrlVtbl;
//HotComm系统内部动态绑定控件事件回调函数!!!(不对外) int CVICALLBACK HotComm_BindCtrlCallBackFunction (int Panel, int Control, int Event, HotComm_BindCtrlArrayStruct *BindCtrlStructPtr, int EventData1, int EventData2);
//HotComm系统内部动态绑定托盘事件回调函数!!!(不对外) int CVICALLBACK HotComm_BindTraylCallBackFunction (int Handle, int Event, int EventData);
HRESULT CVIFUNC HotComm_InterfaceInit (void); HRESULT CVIFUNC HotComm_InterfaceQuit (void);
//1. 通用绑定接口结构参数测试函数 HRESULT CVIFUNC HotComm_GetBindCtrlCount (int Panel, int Control, int * Count, int * MaxCount); //2. 通用绑定接口结构数组参数测试函数 HRESULT CVIFUNC HotComm_GetBindCtrlVal (HotComm_BindCtrlArrayStruct *BindCtrlStructPtr, unsigned int *CommPort, int *Panel, int *Control, int *Attribute, int *AttributeValue, int *Command, int *Event, char *Message, char *Buffer); //3. 通用绑定接口结构数组参数设置函数 HRESULT CVIFUNC HotComm_SetBindCtrlVal (HotComm_BindCtrlArrayStruct *BindCtrlStructPtr, unsigned int CommPort, int Panel, int Control, int Attribute, int AttributeValue, int Command, int Event, char *Message, char *Buffer); //4. 通用取结构指针函数 HotComm_BindCtrlArrayStructPtr CVIFUNC HotComm_GetBindCtrlStructPtr (int Panel, int Control);
//5. 创建绑定 HRESULT CVIFUNC HotComm_CreatBindCtrlVal (unsigned int CommPort, int Panel, int Control, int Attribute, int AttributeValue, int Command, int Event, char *Message, char *Buffer); //6. 在打开串口后才开始绑定 HRESULT CVIFUNC HotComm_BindCtrlCommPortPassword (unsigned int CommPort, int Panel, int Control, const char *Password, const char *NewPassword);
//7. 常绑定 HRESULT CVIFUNC HotComm_BindCtrlSystemPassword (int Panel, int Control, const char *Password, const char *NewPassword);
//8. 在打开串口后才开始绑定 HRESULT CVIFUNC HotComm_BindCtrlCommPortClearTextBox (unsigned int CommPort, int CommandPanel, int CommandControl, int TextPanel, int TextControl);
//9. 常绑定 HRESULT CVIFUNC HotComm_BindCtrlSystemClearTextBox (int CommandPanel, int CommandControl, int TextPanel, int TextControl); //10. 在打开串口后才开始绑定 HRESULT CVIFUNC HotComm_BindCtrlCommPortPushButton (unsigned int CommPort, int CommandPanel, int CommandControl, int LedPanel, int LedControl, int LedInverseint, int Escape);
//11. 常绑定系统托盘 HRESULT CVIFUNC HotComm_BindCtrlSystemTrayIcon (int MainPanel, int Panel, int Control, const char *TrayCaption, const char *ShowIconFileName, const char *HideIconFileName);
//12. 绑定垂直滚动条 HRESULT CVIFUNC HotComm_BindCtrlVscrollBar (int CommPort, int Panel, int Control);
//13. 绑定OPEN开关 HRESULT CVIFUNC HotComm_BindCtrlSystemPowerButton (int Panel, int Control, int LedPanel, int LedControl, void *HookFunction);
HRESULT CVIFUNC HotComm_InstallSysTrayIconMenu (HotComm_BindCtrlArrayStruct *BindCtrlStructPtr, int mode);
HRESULT CVIFUNC HotComm_OpenInternetExplorer (const char* String);
extern IHotComm_BindCtrl *HotComm_BindCtrlInterface;
HRESULT CVIFUNC HotComm_NBGetAdapterMaxCount (int *Count); HRESULT CVIFUNC HotComm_NBGetAdapterAddress (int Lana_num, char *String); HRESULT CVIFUNC HotComm_SystemLicenses (void); HRESULT CVIFUNC HotComm_CheckLicenses (char *String);
#define HDC_FIXED 0x3F6 #define HDC_FIXED_IRQ 0x02
#define HDC_SDH 0x1F6 #define HDC_STATUS 0x1F7 #define HDC_COMMAND 0x1F7 #define HDC_DATA 0x1F0 #define HDC_COMMAND_READPAR 0xEC #define HDC_STATUS_BUSY 0x80
HRESULT CVIFUNC HotComm_ReadIDE (WORD *pwDiskData);
#ifdef __cplusplus extern "C" { #endif
#ifdef __cplusplus } #endif #endif /* _HOTCOMM_INTERFACE_H */ |