?? fibertestclientdoc.h
字號:
// FiberTestClientDoc.h : interface of the CFiberTestClientDoc class
//
/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_FIBERTESTCLIENTDOC_H__36CCBD4C_FA46_4F4F_97A2_731E0CFF209E__INCLUDED_)
#define AFX_FIBERTESTCLIENTDOC_H__36CCBD4C_FA46_4F4F_97A2_731E0CFF209E__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
//定義最大數據塊、XON字符和XOFF字符
#define MAXBLOCK 4096
#define XON 0x11
#define XOFF 0x13
UINT ComProc(LPVOID pParam);//全局性的公用線程函數
class CFiberTestClientDoc : public CDocument
{
protected: // create from serialization only
CFiberTestClientDoc();
DECLARE_DYNCREATE(CFiberTestClientDoc)
// Attributes
public:
CWinThread* m_pThread; // 代表輔助線程
volatile BOOL m_bConnected; //串口是否聯接,用來標識菜單串口連接和斷開連接是否可用
volatile HWND m_hTermWnd; //保存視圖的窗口句柄
volatile HANDLE m_hPostMsgEvent; // 用于WM_COMMNOTIFY消息的事件對象
OVERLAPPED m_osRead, m_osWrite; // 用于重疊讀/寫
volatile HANDLE m_hCom; // 串行口句柄
int m_nBaud; //波特率
int m_nDataBits; //停止位
int m_nParity; //校驗位
CString m_strPort; //串口號
int m_nStopBits; //停止位
/* int m_nFlowCtrl; //流控制選項
BOOL m_bEcho; //是否在本地回顯
BOOL m_bNewLine; //是否自動換行*/
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CFiberTestClientDoc)
public:
virtual BOOL OnNewDocument();
virtual void Serialize(CArchive& ar);
//}}AFX_VIRTUAL
// Implementation
public:
DWORD ReadComm(char *buf, DWORD dwLength); //讀串口
DWORD WriteComm(char *buf, DWORD dwLength); //寫串口
BOOL ConfigConnection(); //配置連接
void CloseConnection(); //關閉連接
BOOL OpenConnection(); //打開串口
virtual ~CFiberTestClientDoc();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected:
// Generated message map functions
protected:
//{{AFX_MSG(CFiberTestClientDoc)
afx_msg void OnCommConnect();
afx_msg void OnCommDisconnect();
afx_msg void OnCommSettings();
afx_msg void OnUpdateCommConnect(CCmdUI* pCmdUI);
afx_msg void OnUpdateCommDisconnect(CCmdUI* pCmdUI);
afx_msg void OnUpdateCommSettings(CCmdUI* pCmdUI);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_FIBERTESTCLIENTDOC_H__36CCBD4C_FA46_4F4F_97A2_731E0CFF209E__INCLUDED_)
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -