| | |
| | | for (int i = 1; i <= 16; i++)
|
| | | {
|
| | | s1.Format(_T("COM%d"), i);
|
| | | if (get_com_name(s1, s2)) s1 = s2;
|
| | | if (get_com_name(s1, s2)) { s1 = s2; }
|
| | | m_combo_comport.AddString(s1);
|
| | | }
|
| | | sComSelStr = _T("COM3");
|
| | | // sComSelStr = _T("COM3");
|
| | | m_combo_comport.SelectString(0, sComSelStr);
|
| | | m_combo_comport.SetCurSel(2);
|
| | | // m_combo_comport.SetCurSel(2);
|
| | | if (m_nComNum >0)
|
| | | m_combo_comport.SetCurSel(m_nComNum - 1);
|
| | | else {
|
| | | m_combo_comport.SetCurSel(0);
|
| | | }
|
| | | return 0;
|
| | |
|
| | | HKEY hKey;
|
| | | if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, _T("Hardware\\DeviceMap\\SerialComm"), NULL, KEY_READ, &hKey) == ERROR_SUCCESS)
|
| | | {
|
| | |
| | | // TODO: 在此处添加实现代码.
|
| | | ((CComboBox *)GetDlgItem(IDC_COMBO_NETWORK_TYPE))->SetCurSel(0);
|
| | | ((CComboBox *)GetDlgItem(IDC_COMBO_PORT))->SetCurSel(0);
|
| | | ((CComboBox *)GetDlgItem(IDC_COMBO_BAUD))->SetCurSel(8);
|
| | | ((CComboBox *)GetDlgItem(IDC_COMBO_BAUD))->SetCurSel(7);
|
| | |
|
| | | ((CButton *)GetDlgItem(IDC_RADIO_DATA_LENGTH_8B))->SetCheck(1);
|
| | |
|
| | |
| | | ((CButton *)GetDlgItem(IDC_CHECK_AUTO_PARITY))->SetCheck(1);
|
| | |
|
| | | UpdateComPortList();
|
| | |
|
| | | CString s1;
|
| | | if (m_bOpened) s1 = _T("已连接"); else s1 = _T("未连接");
|
| | | ((CStatic*)GetDlgItem(IDC_STATIC_STATE))->SetWindowText(s1);
|
| | | return 0;
|
| | | }
|
| | |
|