<DIV>Hello,</DIV> <DIV> </DIV> <DIV>I am trying to use native ITK (as opposed to ManagedITK) in Manged C++ of VS2005.</DIV> <DIV> - it compiles, links 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> </DIV> <DIV>Debug Assertion Failed!</DIV> <DIV>Program:...<BR>File: dbgheap.c<BR>Line: 1414</DIV> <DIV>Expression: _CrtIsValidHeapPointer(pUserData)</DIV> <DIV> </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> </DIV> <DIV>Regards,</DIV>
<DIV>Young.</DIV><FONT color=#0000ff size=2> <DIV> </DIV> <DIV> </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->SetOperation(ADD);</DIV> <DIV> </DIV> <DIV></FONT><FONT color=#008000 size=2>// ITK Test</DIV> <DIV>typedef itk::Image<float> 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->SetRegions( region );</DIV> <DIV>image->Allocate();</DIV></FONT><FONT size=2> <DIV>}</DIV></FONT> <DIV> </DIV><p> 
<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.