在vc里面是可以翻译通过的 所以vs2019的时候翻译不提供 com

BOOL CComCfgDlg::OnInitDialog()
{
CDialog::OnInitDialog();

// TODO: Add extra initialization here
CString str;
for (UINT i = 1; i <= 254; i++)
{
    str.Format("COM%d", i);
    m_cmbComPort.AddString(str);
}
m_strAppPath = GetAppPath();
m_strFilePathINI = m_strAppPath + "\\配置.ini";
INT comPORT = GetPrivateProfileInt("COM", "PORT_SEL", 0, m_strFilePathINI);
INT comBAUD = GetPrivateProfileInt("COM", "BAUD_SEL", 0, m_strFilePathINI);
m_cmbComPort.SetCurSel(comPORT);
m_cmbComBaud.SetCurSel(comBAUD);
return TRUE;  // return TRUE unless you set the focus to a control
              // EXCEPTION: OCX Property Pages should return FALSE

}

void CComCfgDlg::OnSelchangeCmbPort()
{
// TODO: Add your control notification handler code here
CString str;
m_cmbComPort.GetLBText(m_cmbComPort.GetCurSel(), str);
if (str.GetLength() > 3)
{
str.Delete(0, 3);
}
WritePrivateProfileString("COM", "PORT", str, m_strFilePathINI);
str.Format("%d", m_cmbComPort.GetCurSel());
WritePrivateProfileString("COM", "PORT_SEL", str, m_strFilePathINI);
}

void CComCfgDlg::OnSelchangeCmbBaud()
{
// TODO: Add your control notification handler code here
CString str;
m_cmbComBaud.GetLBText(m_cmbComBaud.GetCurSel(), str);
WritePrivateProfileString("COM", "BAUD", str, m_strFilePathINI);
str.Format("%d", m_cmbComBaud.GetCurSel());
WritePrivateProfileString("COM", "BAUD_SEL", str, m_strFilePathINI);
}