?? serialappdlg1.h
字號(hào):
#if !defined(AFX_SERIALAPPDLG1_H__64B6FACE_A19B_4763_A2D6_138E03C3127D__INCLUDED_)
#define AFX_SERIALAPPDLG1_H__64B6FACE_A19B_4763_A2D6_138E03C3127D__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// SerialAppDlg1.h : header file
//
#include "Resource.h"
#include "SerialPort.h"
#include "ConfigDlg.h"
#include <io.h>
#include <memory.h>
#include <iostream.h>
#include <string.h>
#include <stdlib.h>
#include <malloc.h>
#include <math.h>
#include <stdio.h>
#define PI 3.1416
#define WM_MSG_READ WM_USER+20
//定義同步字節(jié)
const BYTE ACK[1]={0xfe};
const BYTE COMMAND[3]={0x33,0x34,0xff};
const WORD nPackSize=0x1000;
const int nSendBuffer=nPackSize*10;
const DWORD TIMELIMIT=3000; // 0.01 Second
const DWORD MAXTIME=300000;
const DWORD SYNTIME=300000; //for send SYN
const DWORD RSDTIME=30000; //for resend
float g_x0=0;
/////////////////////////////////////////////////////////////////////////////
// CSerailAppDlg dialog
class CSerialAppDlg : public CDialog //xxxxxxxx
{
// Construction
public:
CSerialAppDlg(CWnd* pParent = NULL); // standard constructor
~CSerialAppDlg();
// Dialog Data
//{{AFX_DATA(CSerialAppDlg)
enum { IDD = IDD_SERIALAPP_DIALOG };
CProgressCtrl m_ProgressCtrl;
float m_x;
CString m_Num;
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CSerialAppDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
int m_nNum; //記數(shù)
unsigned char *pfbuf;
unsigned char *pfbuf1;
//unsigned char *pfbuf2;
BOOL SendFile();
BOOL ReceiveFile();
void WriteMsg(CString str);
int WriteCommBlock(unsigned char* pBlock, int nLength);
int ReadCommBlock(unsigned char* pBlock, int nMaxLength);
HICON m_hIcon;
CToolBar m_wndToolBar;
CSerialPortEx m_Port; //類對(duì)象
CString m_strReceived; //存儲(chǔ)由串口接收到的數(shù)據(jù)
// Attributes
public:
void Calculate();
static UINT SendThread(LPVOID pParam);
static UINT ReceiveThread(LPVOID pParam);
int m_nComm;
int m_nBandRate;
char m_cParity;
int m_nDataBits;
int m_nStopBits;
int m_nSendBuffer;
// int lishan_q; //全局變量
DWORD m_dwCommEvents; //為串口參數(shù)添加成員
// Generated message map functions
//{{AFX_MSG(CSerialAppDlg)
virtual BOOL OnInitDialog();
afx_msg void OnConnect();
afx_msg void OnDisconnect();
afx_msg void OnConfig();
afx_msg void OnCheck1();
afx_msg void OnNext();
afx_msg void Onzero();
afx_msg void Onmotorback();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_SERIALAPPDLG1_H__64B6FACE_A19B_4763_A2D6_138E03C3127D__INCLUDED_)
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -