I need HGLOBAL for the data contained in CRichEditCtrl
-
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
-
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
Use
CRichEditCtrl::StreamOut()
and write your own stream callback function, in that you copy raw bits from rich edit control toHGLOBAL
. See theEDITSTREAM
andCRichEditCtrl
documentation for details. Robert-Antonio -
Use
CRichEditCtrl::StreamOut()
and write your own stream callback function, in that you copy raw bits from rich edit control toHGLOBAL
. See theEDITSTREAM
andCRichEditCtrl
documentation for details. Robert-Antoniothanks alot brother..you solved the problem almost 95 % Regards Muhammad Ahmed ahmed
-
Use
CRichEditCtrl::StreamOut()
and write your own stream callback function, in that you copy raw bits from rich edit control toHGLOBAL
. See theEDITSTREAM
andCRichEditCtrl
documentation for details. Robert-Antoniothe 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
-
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
The callback function takes the
cb
parameter, which contains required size ofCRichEditCtrl
data. You can grow theHGLOBAL
memory withGlobalRealloc
. Robert-Antonio