these codes are the WM_CHAR handler, but outputs nothing when type some words??
void CMy3456View::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)
{
Invalidate(true);
//MessageBox(L"dfs");//enable this line,then the outputs turns normal,why???
CClientDC dc(this);
CString c=L"";
c.Format(L"%c",nChar);
dc.TextOutW(0,0,c);
CView::OnChar(nChar, nRepCnt, nFlags);
}
You should not be painting in the window inside OnChar, you should let your WM_PAINT handler process it.
Invalidatecauses a WM_ERASEBKGND and WM_PAINT to follow soon after, which is probably erasing the results of your TextOutW.