再activex控件中使用ccombobox中出现的问题!
我做了一个activex控件, 其中一个ccombobox控件,为了使ccombobox能响应回车(就是通过回车提交一个消息,就像ie的地址兰一样),我从载了ccombobox,重写了
BOOL CMyComboBox::PreTranslateMessage(MSG* pMsg)
{
// TODO: Add your specialized code here and/or call the base class
AfxMessageBox("hello!");
if (pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_RETURN)
{
CRichEditCtrl *pRichEditCtrl = (CRichEditCtrl*)GetParent()->GetDlgItem(IDC_RICHEDIT);
CString strTemp;
GetWindowText(strTemp);
pRichEditCtrl->SetWindowText(strTemp);
return TRUE;
}
return CComboBox::PreTranslateMessage(pMsg);
}
为什么再调试中我回车的时候这个函数根本进不去,为什么? 同时我再一个普通的dialog中使用了一下,在这个函数中能接到回车。 能使用。