Click here to Skip to main content
15,885,278 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
i want to use this method connected with message WM_CHAR

this OnChar() is the event handler addeed to our view Class

C++
void CKeyStrokesView::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)
{
    // TODO: Add your message handler code here and/or call default
    CKeyStrokesDoc *pDoc = GetDocument();
    ASSERT_VALID(pDoc);
    pDoc->stringdata += nChar;
    Invalidate();
    CView::OnChar(nChar, nRepCnt, nFlags);
}

stringdata is of type CString declared in CKeyStrokesDoc.h

Waiting for ur Reply

Regards
Sangita
Posted
Updated 22-Feb-10 0:52am
v2

You define nChar as a UINT but CString() does not have an overload for this. Change the line to
pDoc->stringdata += (TCHAR)nChar;
 
Share this answer
 
Try it :) :
...
CString cszTemp;
cszTemp.Format(_T("%u;"), nChar);
pcDoc->m_strData += cszTemp;
...
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900