<html><div style='background-color:'><DIV class=RTE>
<P><FONT face="Times New Roman, Times, Serif" size=2>Hi,</FONT></P>
<P><FONT face="Times New Roman, Times, Serif" size=2>I have a problem while
editing my code with VC6.0 in WindowsXP.</FONT></P>
<P><FONT face="Times New Roman, Times, Serif" size=2>I was following the
example which is in ItkSoftwareGuide-2.6.0.pdf, Chapter 7.12.5 <FONT
color=#333300>Printing DICOM Tags From One Slice</FONT>.(Page
305)</FONT></P>
<P><FONT size=2><FONT face="Times New Roman, Times, Serif">When it run into
the while loop for the first time, everything was perfect. However,after
++itr; run into the while for the second loop, the cursor run to this
line: <EM>MetaDataStringType::Pointer entryvalue
=dynamic_cast<MetaDataStringType *>( entry.GetPointer() ) ;
</EM></FONT></FONT></P>
<P><FONT face="Times New Roman" size=2>then it was caught by the
</FONT></P>
<P><FONT face="Times New Roman" size=2><EM>catch (...)
{<BR>
CHKExceptionProcess::GetHKExc()->Execute ("CHKReader_Dicom::ReadFile()
Error ! ");<BR> return
-1;<BR> }</EM></FONT></P>
<P><FONT face="Times New Roman, Times, Serif" size=2>in order to find out
what was wrong, I changed the code as follows,</FONT></P>
<P><FONT face="Times New Roman, Times, Serif"
size=2><EM>......</EM></FONT></P>
<P><FONT face="Times New Roman" size=2><EM>itr++;</EM></FONT></P>
<P><FONT face="Times New Roman, Times, Serif" size=2><EM>//while( itr !=
end )</EM></FONT><FONT face="Times New Roman, Times, Serif"
size=2><EM>{<BR>itk::MetaDataObjectBase::Pointer entry =
itr->second;<BR>MetaDataStringType::Pointer entryvalue
=<BR>dynamic_cast<MetaDataStringType *>( entry.GetPointer() )
;</EM></FONT></P>
<P><FONT face="Times New Roman, Times, Serif"
size=2><EM>......</EM></FONT></P>
<P><FONT face="Times New Roman, Times, Serif"
size=2><EM>//++itr;</EM></FONT></P>
<P><FONT face="Times New Roman, Times, Serif"
size=2><EM>//}</EM></FONT></P>
<P><FONT face="Times New Roman, Times, Serif" size=2>Again, when it run to
dynamic_cast, the exception came out as the same.</FONT></P>
<P><FONT face="Times New Roman, Times, Serif" size=2>I wonder to
know how to fix in this case. Is it the smart point or the
const_iterator which I am in wrong use? or the operator++, or the
dynamic_cast cause this problem?</FONT></P>
<P><FONT face="Times New Roman, Times, Serif" size=2>I have included the
needed headfiles, perhaps is not this reason.</FONT></P>
<P><FONT face="Times New Roman" size=2>Longing for some kind people to
reply.</FONT><FONT face="Times New Roman, Times, Serif"
size=2><BR></FONT><BR><BR></P>
<DIV></DIV><FONT color=#000000></DIV>
<DIV></DIV></FONT></div><br clear=all><hr>Ãâ·ÑÏÂÔØ <a
href="http://g.msn.com/8HMACNCN/2740??PS=47575" target="_top">MSN Explorer
</a> </html>