Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Streaming RichEdit Control Data
#2
You can use functions RichEditLoad and RichEditSave. Also, rich text files can be automatically loaded into rich edit controls in custom dialogs.

_________________

I found these functions in my archive but don't remember whether they are complete and worked.

Function RtfOpen
Code:
Copy      Help
;/
function# hre $filename

EDITSTREAM es
es.pfnCallback=&RtfOpenProc
es.dwCookie=CreateFile(filename GENERIC_READ 0 0 OPEN_EXISTING FILE_ATTRIBUTE_NORMAL 0)
if(es.dwCookie=-1) ret
SendMessage(hre EM_STREAMIN SF_RTF &es)
CloseHandle(es.dwCookie)
ret !es.dwError

Function RtfOpenProc
Code:
Copy      Help
function dwCookie !*pbBuff cb *pcb
ReadFile(dwCookie pbBuff cb pcb 0)

Function RtfSave
Code:
Copy      Help
;/
function# hre $filename

EDITSTREAM es
es.pfnCallback=&RtfSaveProc
es.dwCookie=CreateFile(filename GENERIC_WRITE 0 0 CREATE_ALWAYS FILE_ATTRIBUTE_NORMAL 0)
if(es.dwCookie=-1) ret
SendMessage(hre EM_STREAMOUT SF_RTF &es)
CloseHandle(es.dwCookie)
ret !es.dwError

Function RtfSaveProc
Code:
Copy      Help
function dwCookie !*pbBuff cb *pcb
WriteFile(dwCookie pbBuff cb pcb 0)


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)