Sorry if iam in the wrong place, (first time posted, long time reader)

My question is, iam having a problem with richedit, i have a richedit box set up, and iam currently setting wordwrap on, and i have it wrapping for ~ 55 chars, which suits me fine, however iam streaming the text to memory and writing it into a file, and the wordwrap for some reason, is not entering the CRLF's so the lines are being written as just long lines, until parts i have pressed Enter.

Here is the code iam using to set the initial wordwrap, and setup the box.


invoke SendMessage,hREdedit,EM_EXSETSEL,0,addr chrg
invoke SendMessage,hREdedit,EM_LIMITTEXT,-1,0
invoke SendMessage,hREdedit,WM_SETFONT,hFont,0
invoke SendMessage,hREdedit,EM_SETMODIFY,FALSE,0
invoke SendMessage,hREdedit,EM_SETEVENTMASK,0,ENM_MOUSEEVENTS
invoke GetDC,hREdedit
invoke SendMessage, hREdedit, EM_SETTARGETDEVICE, eax, 6000
invoke SendMessage,hREdedit,EM_EMPTYUNDOBUFFER,0,0


and here is the code to steam the text to memory.



mov TextLength.flags,GTL_USECRLF
invoke SendMessage,hREdedit,EM_GETTEXTLENGTHEX,addr TextLength,NULL ;Get the amount of text

mov gtx.cb,eax ;Save it for the steam out part.
invoke GetProcessHeap
mov ebx,gtx.cb
invoke HeapAlloc,eax,HEAP_ZERO_MEMORY,ebx ;allocate memory to Srteam it to.
mov NotesHeap,eax
mov gtx.lpDefaultChar,NULL
mov gtx.lpUsedDefChar,NULL
mov gtx.flags,GT_USECRLF
mov gtx.codepage,0
invoke SendMessage,hREdedit,EM_GETTEXTEX,addr gtx,NotesHeap ;Stream it.


Any help is appreciated, and thanks :)
Posted on 2004-08-28 00:18:25 by m00gle