Hello everyone,
I am trying to access the first child node in an XML file with the following code. it works when I did it in DEBUG mode. However, when I run it in RELEASE mode, I always got error at this line of code:
QDomNode tempDomNode = xmlRoot->firstChild();
the error message is: Unhandled exception at 0x670015b5 in aTest.exe: 0xC0000005: Access violation writing location 0x00530058.
when I click the break button in Visual Studio, it shows the free.c file.
Can anyone let me know the problem or the possible reason?
thank you!
QFile aFile
( strFilename
);
if ( !aFile.exists() )
return;
bool bSuccess = document.setContent( &aFile, &errorString, &errorLine, &errorColumn );
if ( !bSuccess )
return;
if( xmlRoot->isNull())
return;
// Read the first child
QDomNode tempDomNode
= xmlRoot
->firstChild
();
...
QFile aFile( strFilename );
if ( !aFile.exists() )
return;
QDomDocument document;
bool bSuccess = document.setContent( &aFile, &errorString, &errorLine, &errorColumn );
if ( !bSuccess )
return;
QDomElement * xmlRoot = &(document.documentElement());
if( xmlRoot->isNull())
return;
// Read the first child
QDomNode tempDomNode = xmlRoot->firstChild();
...
To copy to clipboard, switch view to plain text mode
Bookmarks