[Insight-users] trouble getting ITK and Managed Extensions to C++ to work

Abhishek gattani at aktina.com
Fri Mar 4 18:24:27 EST 2005


Hi All,

 

I still have some serious trouble writing managed C++ extensions to ITK. I
created a Windows Control Library with Managed Extensions. Added a managed
wrapper and made some simple ITK calls. The code compiles and links. But at
run-time when I get out of the function, setFileName, I am getting a
_BLOCK_TYPE_IS_VALID(pHead->nBlockUse) debug assert failure. If any one has
any pointers or a sample project I would deeply appreciate your help. Here
is the error code. Thanks in advance,

 

-Cheers,

Abhishek

 

#pragma once

 

#include "./aktRegisterPointSets.h"

#include "./akt3DImageImporter.h"

using namespace System;

using namespace System::ComponentModel;

using namespace System::Collections;

using namespace System::Windows::Forms;

using namespace System::Data;

using namespace System::Drawing;

 

using namespace System::Runtime::InteropServices;

 

 

#include <stdlib.h>

 

namespace aktImporter

{

      

      public __gc class aktImporterControl : public
System::Windows::Forms::UserControl

      {     

      public:

            aktImporterControl(void)      

            {

                  InitializeComponent();

            }

            

      protected:

            void Dispose(Boolean disposing)     

            {

                  if (disposing && components)

                  {

                        components->Dispose();

                  }

                  __super::Dispose(disposing);

            }

            

      private:

      

            System::ComponentModel::Container* components;

 

      

            void InitializeComponent(void)

            {

            }

      public:

 

            void setFileName(System::String *fileName)

            {

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

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

            

            }

      };

}

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20050304/6b1c045e/attachment.htm


More information about the Insight-users mailing list