Example_vcDlg.h
资源名称:test.rar [点击查看]
上传用户:wuxg88
上传日期:2022-05-28
资源大小:814k
文件大小:3k
源码类别:
通讯编程
开发平台:
C++ Builder
- // Example_vcDlg.h : header file
- //
- #if !defined(AFX_EXAMPLE_VCDLG_H__93132B08_760C_4CAB_B7CF_C28534199009__INCLUDED_)
- #define AFX_EXAMPLE_VCDLG_H__93132B08_760C_4CAB_B7CF_C28534199009__INCLUDED_
- #if _MSC_VER > 1000
- #pragma once
- #endif // _MSC_VER > 1000
- //#define DYNAMIC_LOAD // Switch to dynamic/static load
- /////////////////////////////////////////////////////////////////////////////
- // CExample_vcDlg dialog
- class CExample_vcDlg : public CDialog
- {
- // Construction
- public:
- CExample_vcDlg(CWnd* pParent = NULL); // standard constructor
- #ifdef DYNAMIC_LOAD // Dynamic load
- // Dynamic load: Step 1/3
- HINSTANCE hDMTDll;
- // Open Modbus Serial
- int (WINAPI *OpenModbusSerial)(int conn_num, int baud_rate,
- int data_len, char parity,
- int stop_bits, int modbus_mode);
- // Close Serial
- void (WINAPI *CloseSerial)(int conn_num);
- // Get Serial Error Message Function
- int (WINAPI *GetLastSerialErr)();
- // Clear Serial Error Message Function
- void (WINAPI *ResetSerialErr)();
- // Open Modbus TCP Socket
- int (WINAPI *OpenModbusTCPSocket)(int conn_num, int ipaddr);
- // Close Socket
- void (WINAPI *CloseSocket)(int conn_num);
- // Read Select
- int (WINAPI *ReadSelect)(int conn_num, int SelectTime_msec);
- // Get Socket Error Message Function
- int (WINAPI *GetLastSocketErr)();
- // Clear Socket Error Message Function
- void (WINAPI *ResetSocketErr)();
- // Request Modbus Data
- int (WINAPI *RequestData)(int comm_type, int conn_num, int slave_addr, int func_code,
- const unsigned char *data, int datalen);
- // Response Modbus Data
- int (WINAPI *ResponseData)(int comm_type, int conn_num, int *slave_addr, int *func_code,
- unsigned char *data);
- #endif
- // Dialog Data
- //{{AFX_DATA(CExample_vcDlg)
- enum { IDD = IDD_EXAMPLE_VC_DIALOG };
- CEdit m_modbus_func_r;
- CEdit m_modbus_addr_r;
- CComboBox m_comport;
- CComboBox m_modbus_mode;
- CComboBox m_comm_type;
- CEdit m_modbus_data_r;
- CIPAddressCtrl m_ipaddress1;
- CEdit m_modbus_addr_s;
- CEdit m_modbus_func_s;
- CEdit m_modbus_data_s;
- //}}AFX_DATA
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CExample_vcDlg)
- protected:
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
- //}}AFX_VIRTUAL
- // Implementation
- unsigned char ASCI_to_HEX(unsigned char asci[]); // Convert ASCII to HEX
- void HEX_to_ASCI(unsigned char value_hex, unsigned char *asci); // Convert HEX to ASCII
- int HexStr_to_Int(const TCHAR *value); // Convert a "Hex String" to an Integer
- #ifdef DYNAMIC_LOAD
- BOOL InitDMT(); // Initial DMT
- #endif
- protected:
- HICON m_hIcon;
- // Generated message map functions
- //{{AFX_MSG(CExample_vcDlg)
- virtual BOOL OnInitDialog();
- afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
- afx_msg void OnPaint();
- afx_msg HCURSOR OnQueryDragIcon();
- virtual void OnOK();
- afx_msg void OnSelchangeCombo1();
- afx_msg void OnDestroy();
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
- };
- //{{AFX_INSERT_LOCATION}}
- // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
- #endif // !defined(AFX_EXAMPLE_VCDLG_H__93132B08_760C_4CAB_B7CF_C28534199009__INCLUDED_)