Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi-BCB/Internet/Controls/TXMLDocument/MSXML    [ Add a report in this area ]  
Report #:  37828   Status: Reported
Setting TXMLDocument.OnAsyncLoad event handler to nil causes EOLEException when DOMVendor is MSXML
Project:  Delphi Build #:  10.0.2288.42451
Version:    10.0 Submitted By:   Werewolf =)
Report Type:  Crash / Data loss / Total failure Date Reported:  12/18/2006 3:26:37 AM
Severity:    Serious / Highly visible problem Last Updated: 12/18/2006 4:24:38 AM
Platform:    All platforms Internal Tracking #:  
Resolution: None  Resolved in Build: : None
Duplicate of:  None
Voting and Rating
Overall Rating: (1 Total Rating)
3.00 out of 5
Total Votes: None
Description
Setting TXMLDocument.OnAsyncLoad event handler to nil causes EOLEException when DOMVendor is MSXML
What if I need nil OnAsyncLoad event handler for ex. when I want to abort xml load...

problem code is in msxmldom.pas
---------------------------------------------------
procedure TMSDOMDocument.set_OnAsyncLoad(const Sender: TObject;
  EventHandler: TAsyncEventHandler);
begin
  if Assigned(EventHandler) then
    MSDocument.onreadystatechange := TMSDOMEventHandler.Create(Self,
      EventHandler, Sender) as IDispatch
  else
    MSDocument.onreadystatechange := VarNull;   /////here
end;
Steps to Reproduce:
1) Create new VCL Forms Application
2) Drop TXMLDocument on mainform
3) Include poAsyncLoad to XMLDocument1.ParseOptions
4) Drop TButton on form
5) write such event handler for button1.OnClick
procedure TForm1.Button1Click(Sender: TObject);
begin
XMLDocument1.LoadFromFile('http://qc.codegear.com/wc/qcmain.aspx');
XMLDocument1.OnAsyncLoad:=nil;
XMLDocument1.LoadFromFile('http://dn.codegear.com/help/about');
end;

6)Run program and click the button.
Workarounds
None
Attachment
None
Comments

None

Server Response from: ETNACODE01