⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 comdlg.h

📁 运用通信API编写串口通信。 功能:1)通过串口进行数据的收发并在接收端显示收到的数据 2)打开串口
💻 H
字号:
// comDlg.h : header file
//

#if !defined(AFX_COMDLG_H__DB5DA5F0_9762_462F_A510_D50C7E1784FC__INCLUDED_)
#define AFX_COMDLG_H__DB5DA5F0_9762_462F_A510_D50C7E1784FC__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
//#define WM_COMMNOTIFY WM_USER+100 
#include "config.h"
#include <math.h>
#include <string.h>
#include <stdlib.h>
#include <deque>
using namespace std;
/////////////////////////////////////////////////////////////////////////////
// CComDlg dialog


DWORD WINAPI CommProc(LPVOID pParam);

class CComDlg : public CDialog
{
	// Construction
public:
	int ConvertString(CString str, BYTE SendData[]);
	char ConvertSingleChar(char ch);

	
	CComDlg(CWnd* pParent = NULL);	// standard constructor	
	void Writecom(CString strInput);
	Cconfig  myconfig;           
	LPCTSTR   myCom;				
	DWORD     myBaudRate;	
	BYTE      myByteSize;			
	BYTE      myStopBits;		
	BYTE      myParity;				
	DWORD	  myfParity;
	BOOL      btnOpened;
	BOOL judge(deque<BYTE> & data,CString &recvStr  );
	
// Dialog Data
	//{{AFX_DATA(CComDlg)
	enum { IDD = IDD_COM_DIALOG };
	CButton	m_btnConfig;
	CStatic	m_RealSend;
	CEdit	m_editSend;
	CButton	m_btnCancel;
	CEdit	m_editReceive;
	CButton	m_btnSend;
	CButton	m_btnClosePort;
	CButton	m_btnOpenPort;
	CString	m_strSend;
	CString	m_strReceive;
	//}}AFX_DATA

	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CComDlg)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:
	HICON m_hIcon;
	afx_msg LRESULT OnCommNotify(WPARAM wParam, LPARAM lParam);
	// Generated message map functions
	//{{AFX_MSG(CComDlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	afx_msg BOOL OnButtonOpenport();
	afx_msg void OnButtonCloseport();
	afx_msg void OnButtonSend();
	afx_msg void OnButtonConfig();
	afx_msg void OnButtonC();
	afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_COMDLG_H__DB5DA5F0_9762_462F_A510_D50C7E1784FC__INCLUDED_)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -