Hi all,<br><br>I have a windows form app in C# as my interface and I have some methods written in C++ dll using the ITK library<br><br>what I did is to create a function(ReadImage) that reads an image and return it as:<br>
itk::ImageSource<itk::Image<unsigned short,2>>::OutputImageType* obj;<br>obj = static_cast<itk::Image<unsigned short,2>*>(reader->GetOutput());<br>return obj;<br><br>and another function(WriteImage) in the same dll will take that output as an Input to to an ITK writer<br>
<br>when I call the (WriteImage) function in the (ReadImage) within the dll everything goes perfectly <br>but when I do the following I get memory violation:<br>I call the (ReadImage) from C# and assign the output to Intptr<br>
then I call the (WriteImage) from C# and insert the Intptr as an Input<br>the second call gives always a memory violation error<br><br>any idea of what can I do?<br>