抉择不悔

倒计时


日志分类
小站公告
“人只不过是一根苇草,是自然界最脆弱的东西;但他是一根能思想的苇草。用不着整个宇宙都拿起武器来才能毁灭他;一口气、一滴水就足以致他死命了。然而,纵使宇宙毁灭了他,人却仍然要比致他于死命的东西更高贵得多;因为他知道自己要死亡,以及宇宙对他所具有的优势,而宇宙对此却是一无所知。因而,我们全部的尊严就在于思……”
    ----帕斯卡尔
最新日志
最新回复
最新留言
用户登陆
博客统计
博客名称:抉择不悔 日志总数:20 评论数量:4 访问次数:97369 建立时间::2005年05月21日

 [我的文摘] 如何解决 DHtmlEdit 提示"不支持此接口" (DELPHI)
标签(TAG): Having found the DHTMLEdit looked ideal solution except this "Unknown
interface"

Think I have a potential solution (not as nice as I would like due to
issues overriding interfaces :s)

Here is what I have done in Delphi 7:

Save a copy of OleCtrls.pas in your projects dir. modify the
TOleControl definition - add interface IOleContainer - should look
something like this:

TOleControl = class(TWinControl, IUnknown, IOleClientSite,
IOleControlSite, IOleInPlaceSite, IOleInPlaceFrame, IDispatch,
IPropertyNotifySink, ISimpleFrameSite, IOleContainer)

Add the following to the protected section of TOleControl

//IOleContainer
function EnumObjects(grfFlags: Longint; out Enum: IEnumUnknown):
HResult; stdcall;
function LockContainer(fLock: BOOL): HResult; stdcall;
function ParseDisplayName(const bc: IBindCtx; pszDisplayName:
POleStr; out chEaten: Longint; out mkOut: IMoniker): HResult; stdcall;

and the corresponding implementation

function TOleControl.EnumObjects(grfFlags: Integer;
out Enum: IEnumUnknown): HResult;
begin
 Result := E_NOTIMPL;
end;

function TOleControl.LockContainer(fLock: BOOL): HResult;
begin
  Result := E_NOTIMPL;
end;

function TOleControl.ParseDisplayName(const bc: IBindCtx;
pszDisplayName: POleStr; out chEaten: Integer;
out mkOut: IMoniker): HResult;
begin
Result := E_NOTIMPL;
end;


finally change TOleControl.GetContainer to

function TOleControl.GetContainer(out container: IOleContainer):
HResult;
begin
  container:= Self;
  Result:= S_OK;
end;
抉择不悔 发表于:2005/6/22 13:55:07 阅读(4142) 评论(816)
 

中华工控网 | 联系我们 | 工控论坛首页 | 工控博客首页 | 博客注册 | 博客登陆

工控博客管理联系邮箱:工控博客服务邮箱

中华工控网 © Copyright 2013. All rights reserved.