Results 1 to 4 of 4

Thread: unhandled exception in release mode when calling xmlRoot->firstChild()

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Dec 2008
    Posts
    68

    Default unhandled exception in release mode when calling xmlRoot->firstChild()

    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!

    Qt Code:
    1. QFile aFile( strFilename );
    2. if ( !aFile.exists() )
    3. return;
    4.  
    5. QDomDocument document;
    6.  
    7. bool bSuccess = document.setContent( &aFile, &errorString, &errorLine, &errorColumn );
    8. if ( !bSuccess )
    9. return;
    10.  
    11. QDomElement * xmlRoot = &(document.documentElement());
    12. if( xmlRoot->isNull())
    13. return;
    14.  
    15. // Read the first child
    16. QDomNode tempDomNode = xmlRoot->firstChild();
    17.  
    18. ...
    To copy to clipboard, switch view to plain text mode 
    Last edited by jpn; 24th January 2009 at 16:39. Reason: changed [quote] to [code] tags

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.