求助(50分)

  • 主题发起人 NeverMind
  • 开始时间
N

NeverMind

Unregistered / Unconfirmed
GUEST, unregistred user!
在MDI程序中,于TMDIChildForm上放置DHTMLEdit控件,新建多个子窗口,对其中任一窗口进行
保存后,在关闭此窗口时便会弹出类似"Access violation at address 5B008225 in module
"DHTMLED.OCX".Read of address 00000080"的对话框;若只开一个子窗口,则进行任何操
作都无碍。不知何故,盼高手指点。
 
存取冲突,可能是这个dhtmled.ocx本身的局限所至
 
我也觉得是这个OCX的问题,可以找个新版本的试试看。
 
同意两位楼上的意见。
 
打开delphi生成的DHTMLEDLib_TLB.pas文件,把:
procedure TDHTMLEdit.CreateControl;

procedure DoCreate;
begin
FIntf := IUnknown(OleObject) as IDHTMLEdit;
end;

begin
if FIntf = nil then DoCreate;
end;

改为

procedure TDHTMLEdit.CreateControl;

procedure DoCreate;
begin
FIntf := IUnknown(OleObject) as IDHTMLEdit;
FIntf._AddRef; <--------------增加此行
end;

begin
if FIntf = nil then DoCreate;
end;

应该可以。
 
对于此问题我已经解决了,但还是感谢大家的热情帮助,尤其是Delphi_1.0,我的解决方法
和你一样!:)
 
多人接受答案了。
 
顶部