Home > Back-end >  Ask questions about CRichEditCtrl information input and output
Ask questions about CRichEditCtrl information input and output

Time:09-20

About the control way of the callback input and output, when to close the file

 static DWORD CALLBACK 
MyStreamOutCallback (DWORD dwCookie, LPBYTE pbBuff, LONG cb, LONG * PCB)
{
CFile * pFile=(CFile *) dwCookie;

PFile - & gt; Write (pbBuff, cb);
* PCB=cb;

return 0;
}

CFile CFile (TEXT (" My_RichEdit_OutFile. RTF),
CFile: : modeCreate | CFile: : modeWrite);
EDITSTREAM es.

Es. DwCookie=(DWORD) & amp; CFile;
Es. PfnCallback=MyStreamOutCallback;
M_myRichEditCtrl. StreamOut (SF_RTF, es);


This is the official online see more sample after StreamOut should directly close the file really no problem need to consider the problem of asynchronous read and write files when you should shut down or I should how to obtain the size of the current control information thank you

CodePudding user response:

Very embarrassed, document is to specify in which fill in the text buffer callback function, the callback function called repeatedly, until the finished output stream, thought is asynchronous, then try to output the thread id is found in a thread execution or synchronous so long so there is no problem...

CodePudding user response:

So to personal response to married
  • Related