Provides the functionality of a Windows combo box.
2025-11-04
Written by: xiaobin
Place two combo box controls:
500;1000;2000;
void CSerialCommView::OnInitialUpdate()
{
CFormView::OnInitialUpdate();
GetParentFrame()->RecalcLayout();
ResizeParentToFit();
// Add String
CArray<SSerInfo,SSerInfo&> asi;
// Populate the list of serial ports.
EnumSerialPorts(asi,FALSE/*include all*/);
for (int ii = 0; ii< asi.GetSize(); ii++) {
m_strPortNum.AddString(asi[ii].strFriendlyName);
}
}
CString strTemp;
int nCurSel;
nCurSel = ((CComboBox *) GetDlgItem(IDC_COMBO1Timer))->GetCurSel();
((CComboBox *) GetDlgItem(IDC_COMBO1Timer))->GetLBText(nCurSel, strTemp);