打开DELPHI运行菜单Component->Import ActiveX Control菜单,然后导入DHTML Edit Control For IE5. 其路径是c:\program files\Common Files\Microsoft Shared\Triedit\Dhtmled.ocx)具体看你的操作系统!然后再修改生成的DHTMLEDLib_TLB.pas如下:才不会在关闭时出错误! procedure TDHTMLEdit.CreateControl; procedure DoCreate; begin FIntf := IUnknown(OleObject) as IDHTMLEdit; FIntf._AddRef; <--------------增加此行,其他不变 end; begin if FIntf = nil then DoCreate; end;
其路径是c:\program files\Common Files\Microsoft Shared\Triedit\Dhtmled.ocx)具体看你的操作系统!然后再修改生成的DHTMLEDLib_TLB.pas如下:才不会在关闭时出错误!
procedure TDHTMLEdit.CreateControl; procedure DoCreate;
begin
FIntf := IUnknown(OleObject) as IDHTMLEdit;
FIntf._AddRef; <--------------增加此行,其他不变
end; begin
if FIntf = nil then DoCreate;
end;