Original Post
I''m using the following code to insert & format text into a Subclassed richedit ctrl..
**********
int iTotalLen = GetWindowTextLength();
SetSel(iTotalLen, iTotalLen);
ReplaceSel(szData);
int iStartPos = iTotalLen;
CHARFORMAT cf;
cf.cbSize = sizeof(CHARFORMAT);
cf.dwMask = CFM_COLOR | CFM_UNDERLINE | CFM_BOLD;
cf.dwEffects = (unsigned long) ~( CFE_AUTOCOLOR |
CFE_UNDERLINE | CFE_BOLD);
cf.crTextColor = crColor;
int iEndPos = GetWindowTextLength();
SetSel(iStartPos, iEndPos);
SetSelectionCharFormat(cf);
HideSelection(TRUE, FALSE);
LineScroll(1);
**********
Yet this seems to happen when I insert data into the control using the above code:
-=IMG=-
www.dyaus.com/weird1.jpg
Any ideas on either how to fix it or how to do it properly?
Regards,
Nate Strandberg