Click to See Complete Forum and Search --> : Edit-control problem


beren
April 22nd, 1999, 08:45 AM
Hi. I'm making a CEdit-derived ActiveX-component. I've grabbed the WM_CHAR message and which fires OnChar. MFC's suggestion for code is COleControl::OnChar(nChar, nRepCnt, nFlags);

. This grabs the character so that I can get it with GetText and moves the text-cursor. When I disable this and do a CString a; a=GetText(); a+=nChar; SetText(a)

a following GetText will return blank and the cursor doesn't move.

1) Why does GetText return blank
2) How do I make my cursor move? I can't find nothing in COleControl::OnChar which seems to move the character. In fact, in most of the cases it doesn't seem to do anything when I scroll through it in debug mode.

Sincerely yours

Niklas Saers