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
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. I need HGLOBAL for the data contained in CRichEditCtrl

I need HGLOBAL for the data contained in CRichEditCtrl

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
5 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.
  • M Offline
    M Offline
    Muhammad Ahmed 0
    wrote on last edited by
    #1

    Hello all: can any one please help me how can I get HGLOBAL for the data contained in CRichEditCtrl ,I've to strore the data as BLOB and the class i am using for BLOB need HGLOBAL for that data..please help me in this context... Muhammad Ahmed ahmed

    R 1 Reply Last reply
    0
    • M Muhammad Ahmed 0

      Hello all: can any one please help me how can I get HGLOBAL for the data contained in CRichEditCtrl ,I've to strore the data as BLOB and the class i am using for BLOB need HGLOBAL for that data..please help me in this context... Muhammad Ahmed ahmed

      R Offline
      R Offline
      Robert A T Kaldy
      wrote on last edited by
      #2

      Use CRichEditCtrl::StreamOut() and write your own stream callback function, in that you copy raw bits from rich edit control to HGLOBAL. See the EDITSTREAM and CRichEditCtrl documentation for details. Robert-Antonio

      M 2 Replies Last reply
      0
      • R Robert A T Kaldy

        Use CRichEditCtrl::StreamOut() and write your own stream callback function, in that you copy raw bits from rich edit control to HGLOBAL. See the EDITSTREAM and CRichEditCtrl documentation for details. Robert-Antonio

        M Offline
        M Offline
        Muhammad Ahmed 0
        wrote on last edited by
        #3

        thanks alot brother..you solved the problem almost 95 % Regards Muhammad Ahmed ahmed

        1 Reply Last reply
        0
        • R Robert A T Kaldy

          Use CRichEditCtrl::StreamOut() and write your own stream callback function, in that you copy raw bits from rich edit control to HGLOBAL. See the EDITSTREAM and CRichEditCtrl documentation for details. Robert-Antonio

          M Offline
          M Offline
          Muhammad Ahmed 0
          wrote on last edited by
          #4

          the callback function is called, passing the data in segments, so should i allocate memory on the heap for each call and the integrate the whole data in a newly allocated memory or is there a way to keep appending data to the buffer allocated only once....(or is there a way to find in advance how much buffer we should have?) thanks ahmed

          R 1 Reply Last reply
          0
          • M Muhammad Ahmed 0

            the callback function is called, passing the data in segments, so should i allocate memory on the heap for each call and the integrate the whole data in a newly allocated memory or is there a way to keep appending data to the buffer allocated only once....(or is there a way to find in advance how much buffer we should have?) thanks ahmed

            R Offline
            R Offline
            Robert A T Kaldy
            wrote on last edited by
            #5

            The callback function takes the cb parameter, which contains required size of CRichEditCtrl data. You can grow the HGLOBAL memory with GlobalRealloc. Robert-Antonio

            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