Einzelnen Beitrag anzeigen

Benutzerbild von Neutral General
Neutral General

Registriert seit: 16. Jan 2004
Ort: Bendorf
5.219 Beiträge
 
Delphi 10.2 Tokyo Professional
 
#4

AW: XMLDocument zur Laufzeit -> Exception

  Alt 21. Mai 2015, 16:12
Tipp des Jahrhunderts: Erstelle nie ein TXMLDocument mit Owner = nil.
Dadurch erhält man unter Umständen komische, nicht nachvollziehbare Exceptions.

Im Zweifelsfall erstell dir eine temporäre TComponent-Instanz die du dem constructor von TXMLDocument mitgibst.
Hauptsache nicht nil!

Achja: Du musst das xml Dokument im finally wieder freigeben. Auf nil setzen reicht nicht!
Michael
"Programmers talk about software development on weekends, vacations, and over meals not because they lack imagination,
but because their imagination reveals worlds that others cannot see."
  Mit Zitat antworten Zitat