[Insight-users] RE: itk dll for .net (junhui wang)

Abhishek gattani at aktina.com
Wed Apr 20 17:19:12 EDT 2005


Hi Albert,

 

Developing an application that uses the .NET Framework, requires "Managed
Code". Your code is handled by the common language runtime (CLR) which takes
care of tasks such as garbage collection. ITK is an "unmanaged code"
toolkit. Don't take the literal meaning of the word because I regard ITK as
one of the best pieced of code written, but Microsoft refers to any code
that runs outside the CLR as "unmanaged code". To get ITK to work with a
managed .net application you have the following options. 

 

1)    Use PInvoke (Platform Invocation Services). E.g. build your project as
an unmanaged DLL that uses the ITK toolkit, and in your .NET application use
PInvoke for entry points to your DLL.

2)    Managed Extensions to C++ (mixed mode programming). E.g. write managed
class wrappers around ITK classes which take care of converting data between
managed and unmanaged code. 

3)    COM Interoperability: Write your ITK calls as a COM component and
expose interfaces to be used in a .NET application.

 

Personally I prefer the 3rd as it is the cleanest of all. As you can see the
process of using ITK in a .NET application is a little involved. Hope this
helps.

 

-Cheers,

Abhishek Gattani 

 

   1. itk dll for .net  (junhui wang)

 

Message: 1

Date: Wed, 20 Apr 2005 08:12:47 -0700 (PDT)

From: junhui wang <mskccvb at yahoo.com>

Subject: [Insight-users] itk dll for .net 

To: insight-users at itk.org

Message-ID: <20050420151247.58778.qmail at web50303.mail.yahoo.com>

Content-Type: text/plain; charset=us-ascii

 

Dear ITK users..

   

  I am new to ITK. I want to use ITK under .net

environment. I am using visual studio.net 2003

I can use CMAKE to generate a .net project  and

display the cone well, but I want to use the windows

form of VC++.net to display the cone. My idea is to

create a cone.dll first and then invoke it from

windows form.  Is anybody has idea how to create the

dll using itk?

 

thanks.

 

Albert

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20050420/8e85b9ba/attachment.htm


More information about the Insight-users mailing list