怎么在C++的MFC菜单项,获取USB摄像头的分辨率
例如:在Dialog中使用CComBox类成员GetWindowTextW
void CUVCDemoDlg::OnCbnSelchangeComboFormat()
{
CString strFR;
m_cbo_format.GetWindowTextW(strFR);
if (strFR == L"")
return;
CString strFmt = strFR.Left(4);
if (strFmt == L"MJPG")
m_videoFormat = VIDEOFORMAT_MJPG;
else
m_videoFormat = VIDEOFORMAT_YUY2;
CString strRes = strFR.Mid(4);
swscanf(strRes, L"%dx%d", &m_videoW, &m_videoH);
if (m_bConnectedPrevious) {
OnBnClickedButtonPreview();
}
}
效果图如下

问一下在菜单项中,怎么去获取,感谢


void CMainFrame::OnMenuFormat()
{
CString strFR;
/*m_menu_format.GetWindowTextW(strFR);*/ //类CMenu中没有成员GetWindowTextW
if (strFR == L"")
return;
CString strFmt = strFR.Left(4);
if (strFmt == L"MJPG")
m_videoFormat = VIDEOFORMAT_MJPG;
else
m_videoFormat = VIDEOFORMAT_YUY2;
CString strRes = strFR.Mid(4);
swscanf(strRes, L"%dx%d", &m_videoW, &m_videoH);
if (m_bCameraConnected) {
PostMessage(WM_OPENDEV,0,0);
}
}