c++ - Odd behavior from TinyXML++ -


hoping of tinyxml++ people can me out. really, since recomended me before think owe me ;)

i have following code:

   //ticpp::iterator< ticpp::element > child( "setpiece" );     ticpp::iterator< ticpp::node > child("setpiece");     gluint lc_spieces = 0;     for(child = child.begin( ); child != child.end(); child++ )     {         lc_spieces++;     } 

if use top declaration child error:

unhandled exception @ 0x7c812aeb in drawing.exe: microsoft c++ exception: __non_rtti_object @ 0x0012f7b4.

and in dbgheap.c @ line:

pvblk = _heap_alloc_dbg(nsize, nblockuse, szfilename, nline); 

what's weird works node, , know there elements in there(i checked using tinyxml iteration methods).

has run before?

just poking in dark, don't know tinyxml, seems dynamic_cast went wrong. if dynamic_cast<> pointer, null-pointer on failure. however, if cast reference type, there no concept of null-reference, runtime throws exception (or bad_type). msdn on dynamic_cast, , why can go wrong

the line pasted exception occur not clear situation, since identifies symptom rather cause.

try identify cast went wrong, should able find if walk stack , find last method in tinyxml libs or headers. can decide whether tinyxml worng, or applied wrong way.

good luck!


Comments

Popular posts from this blog

c++ - How do I get a multi line tooltip in MFC -

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -