<DIV>Hello,</DIV>  <DIV>&nbsp;</DIV>  <DIV>I&nbsp;am trying to use native ITK (as opposed to ManagedITK) in Manged C++ of VS2005.</DIV>  <DIV>&nbsp;- it compiles, links&nbsp;fine, but crashes when runs.</DIV>  <DIV>It is from the simple code - creating and allocating an image (see below). </DIV>  <DIV>It actually crashes 'even before the program shows the window'.</DIV>  <DIV>The error message is as following:</DIV>  <DIV>&nbsp;</DIV>  <DIV>Debug Assertion Failed!</DIV>  <DIV>Program:...<BR>File: dbgheap.c<BR>Line: 1414</DIV>  <DIV>Expression: _CrtIsValidHeapPointer(pUserData)</DIV>  <DIV>&nbsp;</DIV>  <DIV>It seems related to a 'bad' pointer - the comment on that file says that.</DIV>  <DIV>I originally suspected that would because I created an image in a managed button event function (as shown below), but it is the same when I do that in a separate unmanaged class.</DIV>  <DIV>Is there any option for this?</DIV>  <DIV>&nbsp;</DIV>  <DIV>Regards,</DIV> 
 <DIV>Young.</DIV><FONT color=#0000ff size=2>  <DIV>&nbsp;</DIV>  <DIV>&nbsp;</DIV>  <DIV>P.S.</DIV>  <DIV>void</FONT><FONT size=2> Form1::btnOp_Add_Click(System::Object^ sender, System::EventArgs^ e)</DIV>  <DIV>{</DIV>  <DIV>Interface-&gt;SetOperation(ADD);</DIV>  <DIV>&nbsp;</DIV>  <DIV></FONT><FONT color=#008000 size=2>// ITK Test</DIV>  <DIV>typedef itk::Image&lt;float&gt; ImageType;</DIV>  <DIV>ImageType::Pointer image = ImageType::New();</DIV>  <DIV>ImageType::SizeType size;</DIV>  <DIV>size[0] = 200; // size along X</DIV>  <DIV>size[1] = 200; // size along Y</DIV>  <DIV>size[2] = 200; // size along Z</DIV>  <DIV>ImageType::RegionType region;</DIV>  <DIV>region.SetSize( size );</DIV>  <DIV>image-&gt;SetRegions( region );</DIV>  <DIV>image-&gt;Allocate();</DIV></FONT><FONT size=2>  <DIV>}</DIV></FONT>  <DIV>&nbsp;</DIV><p>&#32;
      <hr size=1>Don't let your dream ride pass you by.  <a href="http://us.rd.yahoo.com/evt=51200/*http://autos.yahoo.com/index.html;_ylc=X3oDMTFibjNlcHF0BF9TAzk3MTA3MDc2BHNlYwNtYWlsdGFncwRzbGsDYXV0b3MtZHJlYW1jYXI-">  Make it a reality</a> with Yahoo! Autos.