Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / March 2005

Tip: Looking for answers? Try searching our database.

How to create a C++ class to have a .NET interface

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Sam Carleton - 25 Mar 2005 19:50 GMT
There is a 3rd party library that is a bit complex, has a number
of functions and structs and variable length data, the whole bit.
I saw Eric Gunnerson's July 14, 2002, article "Using Existing Code
in C#".  He talks about four different ways to wrap the code in
C++, the last one is: "Modifying a C++ class to have a .NET
interface", but he never talks about how to actually do this.  Can
anyone point me to documentation about how to do this?

Sam
Ajay Kalra - 25 Mar 2005 20:25 GMT
> There is a 3rd party library that is a bit complex, has a number
> of functions and structs and variable length data, the whole bit.
[quoted text clipped - 3 lines]
> interface", but he never talks about how to actually do this.  Can
> anyone point me to documentation about how to do this?

You can use managed extensions (MC++) to wrap an unmanaged class. The
managed wrapper can then be used in C# or other managed code.

--
Ajay Kalra [MVP - VC++]
ajaykalra@yahoo.com
Sam Carleton - 26 Mar 2005 01:15 GMT
>> There is a 3rd party library that is a bit complex, has a
>> number of functions and structs and variable length data, the
[quoted text clipped - 8 lines]
> class. The managed wrapper can then be used in C# or other
> managed code.

Wonderful!  Can you give me the title of an MSDN Document to get
me pointed in the right direction?  So far, the best I have been
able to find is: "Interoperating with Unmanaged Code"  From what
it looks like to me, this only deals with calling an unmanaged
DLL, not wrapping a unmanaged C++ class in a managed C++ class.

Sam
ajaykalra@yahoo.com - 28 Mar 2005 19:37 GMT
This article is little dated but it should still work fine:
http://msdn.microsoft.com/msdnmag/issues/02/02/ModernC/

It demonstrates wrapping a unmanaged class in a managed object.

--------
Ajay Kalra
ajaykalra@yahoo.com

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.