Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 276
  • Last Modified:

Rich Edit Control Steaming

I would like to know how to stream the data that is there in the Rich Edit Control . Please Help.
I am using the CRichEditView class as a base class for the application's view
0
Vijendra
Asked:
Vijendra
1 Solution
 
2goodCommented:
Use the GetRichEditCtrl() member function of the view to access the list control. Use the control's StreamIn and StreamOut functions and make a callback.

It could look something like this...

DWORD CALLBACK EditStreamCallback_Read(DWORD dwCookie,
    LPBYTE pbBuff, LONG cb, LONG FAR *pcb)
{
    CFile * pfile = (CFile *)dwCookie;

      pfile->Read(pbBuff, cb);
      *pcb = cb;

    return 0;
}

void CTheView::SaveToFile(CFile & file)
{
      EDITSTREAM es =
      {
            (DWORD)&file,
            0,
            EditStreamCallback_Read            
      };    

      GetRichEditCtrl().StreamOut(SF_RTF, &es)
}
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now