void CSMSSendDlg::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags) 
{
// TODO: Add your message handler code here and/or call default
    switch(nChar)
{
case 0x31:AfxMessageBox("a");break;
}
CDialog::OnKeyDown(nChar, nRepCnt, nFlags);
}这样错在哪,为什么没反应。

解决方案 »

  1.   

    你先看看OnKeyDown有没有反应吧,在看怎么没有AfxMessageBox("a")
      

  2.   

    void CSMSSendDlg::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
    {
    // TODO: Add your message handler code here and/or call default
        AfxMessageBox("OnKeyDown");   //加个这个
        switch(nChar)
        { 
          case 0x31:AfxMessageBox("a");break;
        }
        CDialog::OnKeyDown(nChar, nRepCnt, nFlags);
      

  3.   

    在函数加个断点,看是否进去另外,就一个case  是不是用if更好点呢?