[Insight-users] ITK run-time error from DLL

Abhishek gattani at aktina.com
Wed Mar 2 17:12:02 EST 2005

Hello All,


I am calling ITK functions from my Windows Control Library (.net) project
which produces a COM DLL and uses Managed Extensions. I only have two ITK
code lines:


typedef itk::Image< unsigned short, 3 > ImageType;

ImageType::Pointer image = ImageType::New();


I get "An unhandled exception of type 'System.NullReferenceException'
occurred in aktimporter.dll Additional information: Object reference not set
to an instance of an object." If I make VTK calls it works fine. My guess is
this has something to do because of templates. I am clueless so any pointers
would be deeply appreciated.


Note: I manually added the ITK setting for the project such as Additional
Include Directories, Library Directories, Dependencies, the /GR option to
enable exceptions in C/C++ command line options, the /MLd option for
Multi-Threaded Debug DLL. I did not use CMake because I did not want to
loose the project options for my existing DLL project.  


Thanks in advance,



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20050302/807ac01a/attachment.htm

More information about the Insight-users mailing list