
BETA903A USER MANUAL
- 67 -
4.3.3.
Example code
Bolymin provides a test application and its source code for example. The following
picture is the screen shot of the serial port test program:
Open/Close
selected serial port.
Received data
Data will be sent by
selected serial port
Clear received data
Clear received data
Clear sent data.
Send data
The major part of source codes of the test program is shown below:
File: SerialPortDlg.cpp
/////////////////////////////////////////////////////////////////////////////
// CSerialPortDlg dialog
/////////////////////////////////////////////////////////////////////////////
const UINT WM_CMD_OK = 1;
BEGIN_MESSAGE_MAP(CSerialPortDlg, CDialog)
//{{AFX_MSG_MAP(CSerialPortDlg)
ON_BN_CLICKED(IDC_OPEN_COM, OnOpenCom)
ON_BN_CLICKED(IDC_CLOSE_COM, OnCloseCom)
ON_BN_CLICKED(IDC_SEND, OnSend)
ON_BN_CLICKED(IDC_CLEAR_SEND, OnClearSend)
ON_BN_CLICKED(IDC_CLEAR_REC, OnClearRec)
ON_WM_DESTROY()
//}}AFX_MSG_MAP
ON_MESSAGE(WM_CMD_OK, OnCommRecv)
END_MESSAGE_MAP()
Map the receive message
processing function to user
defined message.
Define a receive message
/////////////////////////////////////////////////////////////////////////////
// CSerialPortDlg message handlers
/////////////////////////////////////////////////////////////////////////////
Summary of Contents for BETA903A
Page 19: ...BETA903A USER MANUAL 19 1 3 2 Mechanical specifications of Holder Mount ...
Page 49: ...BETA903A USER MANUAL 49 STEP2 Select Windows folder STEP3 Run KeyPadTest program ...
Page 55: ...BETA903A USER MANUAL 55 5 Select No and click Next button to cancel the synchronization ...
Page 60: ...BETA903A USER MANUAL 60 STEP 5 Click Next button STEP 6 Click Next button ...
Page 94: ...BETA903A USER MANUAL 94 STEP 3 Add process code into message processing function ...
Page 95: ...BETA903A USER MANUAL 95 End of BETA903A User Manual ...