🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.internet.web
Article #1567

Re: deleting a TXMLDocument

#1567
From: Fabi�n
Date: Tue, 21 Sep 2004 22:05
59 lines
2748 bytes
You are a genious!!

you are allways right...  i hope some day can be like you (in my dreams)...

Thanks!

Fabi�n

"Remy Lebeau (TeamB)" <no.spam@no.spam.com> escribi� en el mensaje
news:414f5a90$1@newsgroups.borland.com...
>
> "Fabi�n" <fabianfierro@hotmail.com> wrote in message
> news:4148c0b5@newsgroups.borland.com...
>
> > hi...  I'm creating XMLDocuments dinamicaly, but I don't know
> > how to delete them. If I use:  delete XMLDocument;     the
> > compiler throws an error.
>
> TXMLDocument is a special-case class.  It does not act like other classes.
> When dropped onto a form at design-time, it acts like a component.  When
> instantiated dynamically at runtime, it acts like an interface instead.
As
> such, you should not instantiate TXMLDocument dynamically at all.  Use the
> IXMLDocument interface directly instead, via the NewXMLDocument()
function.
> For example:
>
>     void __fastcall TFMain::ServerSocket1ClientRead(TObject *Sender,
> TCustomWinSocket *Socket)
>     {
>         AnsiString Texto, Evento, Room_id;
>         _di_IXMLDocument XMLDocument;
>         _di_IXMLNode Nodo;
>
>         Texto = Socket->ReceiveText();
>         Memo1->Lines->Add(Texto);
>
>         XMLDocument = NewXMLDocument("");
>         try
>         {
>             XMLDocument->LoadFromXML(Texto);
>             Nodo = XMLDocument->DocumentElement->ChildNodes->GetNode(0);
>             Evento = Nodo->Attributes["name"];
>         }
>         catch (const Exception &)
>         {
>             //...
>         }
>     }
>
> When the _di_IXMLDocument wrapper goes out of scope, it will automatically
> free the IXMLDocument for you, the same thing that the _di_IXMLNode
wrapper
> does for the IXMLNode as well.
>
>
> Gambit
>
>
Technical Details
Message-ID: <4150a5b5@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!npeer.de.kpn-eurorings.net!feed.news.schlund.de!schlund.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <4148c0b5@newsgroups.borland.com> <414f5a90$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: feeec,857cefac094b3c55
X-Google-Attributes: gidfeeec,public
X-Google-Language: ENGLISH,ASCII
Reply-To: "Fabi�n" <fabianfierro@hotmail.com>
From: "Fabi�n" <fabianfierro@hotmail.com>
Newsgroups: borland.public.cppbuilder.internet.web
References: <4148c0b5@newsgroups.borland.com> <414f5a90$1@newsgroups.borland.com>
Subject: Re: deleting a TXMLDocument
Date: Tue, 21 Sep 2004 19:05:47 -0300
Lines: 61
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
NNTP-Posting-Host: 200.55.85.72
Message-ID: <4150a5b5@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1095804341 200.55.85.72 (21 Sep 2004 15:05:41 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!npeer.de.kpn-eurorings.net!feed.news.schlund.de!schlund.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail