Bitmap inserted in the RichEdit
Do not know how to MS, such a basic function of the realization that no off-the-shelf? Yesterday after another in the evening finally have a point of coming to an end.
RichEdit through ImportDataObject IRichEditOle interface supports a method, this method can be used to replace the current designated IDataObject Select region, contains only need to create a picture on the IDataObject.
Reading the Reading MSDN, I can guilty of depression, so a popular IDataObject interface in the whole Win32API there was no default achieved? IDataObject to know that the nine members of the IDataAdviseHolder and his ilk associated with the realization of their own garbage additional 200 lines of code but not Xiabulai. Although this view of the current inter-process not only supports the specific picture may achieve much smaller, but I really uninteresting later on overhauling the code.
'll COleDataObject documents carefully look at, is so ambiguous name, was not the realization of IDataObject? MS is not Naozijinshui engineers? Up for a half-hour before the realization that IDataObject COleDataSource included in the inside, I really do not know how to describe the feelings of the time…………
Harvest or some, the realization of the complete surprisingly, including some I did not expect the issue to write on the inside, such remaining issues really do not have the slightest difficulty, the following code:
COleDataSource src;
STGMEDIUM sm;
Sm.tymed = TYMED_GDI;
Sm.hBitmap = hbmp;
Sm.pUnkForRelease = NULL;
Src.CacheData (CF_BITMAP, & sm);
LPDATAOBJECT lpDataObject =
(LPDATAOBJECT) src.GetInterface (& IID_IDataObject);
PRichEditOle-> ImportDataObject (lpDataObject, 0, NULL);
LpDataObject-> Release ();
Wrote here really feel very depressed, I am troubled two days of this is actually more than 10 lines of code. In the end I was grateful to the MS or Gaima it?








0 Comments to “Bitmap inserted in the RichEdit”
No Comments. Send your comment.
Leave a Reply
You must be logged in to post a comment.