At 16.21 30/04/2002 +0800, you wrote:
>I try to create a simple project to using the following code but encounter
>exception when the program exit.
>
>[...]
>int main(int argc, char* argv[])
>{
> XMLPlatformUtils::Initialize();
>
> const char* xmlFile = "e:\\temp\\LogConfiguration.xml";
>
> // Instantiate the DOM parser.
> DOMParser* parser = new DOMParser;
>
> parser->parse(xmlFile);
>
> DOM_Document doc = parser->getDocument();
> delete parser;
> parser = NULL;
>
> // And call the termination method
> //crush, why?????
> XMLPlatformUtils::Terminate();
After you call Terminate, you shouldn't do any work on Xerces data
structures; but you still have a DOM_Document object on the stack, whose
destructor will be called after the Terminate() call.
Try changing the code into
XMLPlatformUtils::Initialize();
{
DOMParser* parser=.....
...
DOM_Document doc= ....
...
}
XMLPlatformUtils::Terminate();
Alberto
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]