自定义的Ole对象实例插入RichEdit后,无法拖动、粘贴、复制,是怎么回事?(100)

  • 主题发起人 主题发起人 starsite
  • 开始时间 开始时间
S

starsite

Unregistered / Unconfirmed
GUEST, unregistred user!
自定义的Ole对象实例插入RichEdit后,无法拖动、粘贴、复制,是怎么回事? 我的Ole对象实现了以下接口: TMyOleObject = class(TInterfacedObject, IOleObject, IViewObject2, IViewObject, IDataObject) ... end; 插入RichEdit的代码是: function InsertMyObject(hRichEdit: THandle): Boolean; var ReOle: IRichEditOle; MyOle: TMyOleObject; OleSite: IOleClientSite; OleObject: IOleObject; ReObj: TReObject; begin ReOle := GetRichEditOle(hRichEdit); Assert(ReOle <> nil, 'RichEditOle is null!'); MyOle := TMyOleObject.Create(); try ReOle.GetClientSite(OleSite); MyOle.GetOleObject(OleSite, OleObject); OleCheck(OleSetContainedObject(OleObject, True)); FillChar(ReObj, Sizeof(ReObj), 0); ReObj.cbStruct := Sizeof(ReObj); OleCheck(OleObject.GetUserClassID(ReObj.clsid)); ReObj.cp := REO_CP_SELECTION; ReObj.dvaspect := DVASPECT_CONTENT; ReObj.poleobj := OleObject; ReObj.polesite := OleSite; ReObj.dwFlags := REO_READWRITEMASK and not(REO_RESIZABLE); ReOle.InsertObject(ReObj); Result := True; finally //,,, end; end;
 
后退
顶部