//通过WM_CHAR可以啊! 可能是你的程序有出路吧!下面是我测试的
//TestView.h 中
class CTestView : public CView
{
protected:
         
char buff[500];  //随便定义一片内存,你的软件可不能这样哦!最好动态分配
long point;   //记录输入字符个数
   .
  .
   .}//TestView.Cpp中
CTestView::CTestView()
{
// TODO: add construction code here
point=0;
buff[point]=0;
}void CTestView::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags) 
{
// TODO: Add your message handler code here and/or call default
buff[point]=nChar;
point++;
buff[point]=0;
//PostMessage(WM_PAINT);  
RedrawWindow();  

CView::OnChar(nChar, nRepCnt, nFlags);
}
void CTestView::OnDraw(CDC* pDC)
{
CTestMDBDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
pDC->TextOut(1,1,buff); 
}//我的就可以输入中文和显示中文,这是你要的吗?

解决方案 »

  1.   


    void CTestView::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags) 
    {
    // TODO: Add your message handler code here and/or call default
    if(point>=499) point=0;   //刚才忘了限制这里,否则输入大于500-1就会出错buff[point]=nChar;
    point++;
    buff[point]=0;
    //PostMessage(WM_PAINT);  
    RedrawWindow();  CView::OnChar(nChar, nRepCnt, nFlags);
    }
      

  2.   

    可能是你的系统问题,或者输入法的问题?我用WM_CHAR能正确处理汉字.