Solved

Rich Edit Control Steaming

Posted on 1997-12-10
1
227 Views
Last Modified: 2013-11-20
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
Comment
Question by:Vijendra
1 Comment
 
LVL 1

Accepted Solution

by:
2good earned 50 total points
ID: 1311994
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now