Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Stream OLE objects into a CRichEditCtrl

Stream OLE objects into a CRichEditCtrl

Scheduled Pinned Locked Moved C / C++ / MFC
comquestion
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    CodeBrain
    wrote on last edited by
    #1

    I am trying for several days to stream RTF text which contains OLE objects (bitmaps) into a CRichEditCtrl. StreamOut works absolutly perfect. If I save the streamed out string to a file, I see the objects if I open the file with wordpad. But if I try to stream the string back into an other control, I only get the plain RTF formatted text and the OLE objects are missing! So, is it not possible to stream in OLE objects into a RTF control? What need to be done if I want to stream RTF text incl. OLE objects into a CRichEditCtrl? Thanks in advance.

    J C 2 Replies Last reply
    0
    • C CodeBrain

      I am trying for several days to stream RTF text which contains OLE objects (bitmaps) into a CRichEditCtrl. StreamOut works absolutly perfect. If I save the streamed out string to a file, I see the objects if I open the file with wordpad. But if I try to stream the string back into an other control, I only get the plain RTF formatted text and the OLE objects are missing! So, is it not possible to stream in OLE objects into a RTF control? What need to be done if I want to stream RTF text incl. OLE objects into a CRichEditCtrl? Thanks in advance.

      J Offline
      J Offline
      Joel Lucsy
      wrote on last edited by
      #2

      Well, it seems the other control isn't handling the ole objects (like, duh!). Look into GetIRichEditOle and SetOLECallback. I haven't tried implementing them myself, but they look to be the key things to get this to work. Joel Lucsy

      C 1 Reply Last reply
      0
      • J Joel Lucsy

        Well, it seems the other control isn't handling the ole objects (like, duh!). Look into GetIRichEditOle and SetOLECallback. I haven't tried implementing them myself, but they look to be the key things to get this to work. Joel Lucsy

        C Offline
        C Offline
        CodeBrain
        wrote on last edited by
        #3

        Thanks for you answer. I also found that OLE stuff, but I am not sure what I should do with it. The M$ "documentation" of the OLE interface of CRichEditCtrl is practically nothing. :mad: I also think, that somewhere in the CRichEditVIEW and CRichEditDOC classes something similar must be done in order to load RTF text with OLE objects. But unfortunately I can't use CRichEditView. I hope someone can give me a hint about it.

        1 Reply Last reply
        0
        • C CodeBrain

          I am trying for several days to stream RTF text which contains OLE objects (bitmaps) into a CRichEditCtrl. StreamOut works absolutly perfect. If I save the streamed out string to a file, I see the objects if I open the file with wordpad. But if I try to stream the string back into an other control, I only get the plain RTF formatted text and the OLE objects are missing! So, is it not possible to stream in OLE objects into a RTF control? What need to be done if I want to stream RTF text incl. OLE objects into a CRichEditCtrl? Thanks in advance.

          C Offline
          C Offline
          CodeBrain
          wrote on last edited by
          #4

          I think this comment in Codeguru can be the solution of the problem: http://www.codeguru.com/mfc/comments/27104.shtml We must implement the IRichEditOleCallback interface. The most important method seems to be GetNewStorage! You can find the full code if you follow the link above!

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups