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++ / May 2005

Tip: Looking for answers? Try searching our database.

migrating unmanaged C++ classes to provide VB interface

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Brett - 12 May 2005 21:55 GMT
We have an application completely written in C++ under visual studio v6. One
of our customers wants to use some of our existing components in his project
but doesn't know C++ and isn't interested in learning it. He does know C#
and VB though.

Whats the best option for us (ie. minimum work) to provide him with an API
that he can use in his own applications to access our C++ classes? I was
originally considering a COM interface, but looking into .NET, I'm wondering
if we should just upgrade the appropriate sections of code to "managed code"
so he can use that from one of his languages. What would be the easier and
most advisable path for us to take, provide an interface with COM or managed
code?

The C++ program has significant custom graphics support (based on MFC) and
has a large set of classes that are capable of controling a USB device.

Any advice is appreciated.

Thanks,
Brett.
Doug Harrison [MVP] - 12 May 2005 22:19 GMT
> We have an application completely written in C++ under visual studio v6. One
> of our customers wants to use some of our existing components in his project
[quoted text clipped - 13 lines]
>
> Any advice is appreciated.

If your customer wants to use your components in .NET apps, provide a .NET
interface. If he wants to use them from, say VB6, provide a COM interface.

Signature

Doug Harrison
Microsoft MVP - Visual C++

Brett - 13 May 2005 18:15 GMT
> > We have an application completely written in C++ under visual studio v6. One
> > of our customers wants to use some of our existing components in his project
[quoted text clipped - 16 lines]
> If your customer wants to use your components in .NET apps, provide a .NET
> interface. If he wants to use them from, say VB6, provide a COM interface.

Why not just provide a COM interface and cover both bases? COM can be called
from .NET can't it?

Brett
Doug Harrison [MVP] - 13 May 2005 19:27 GMT
> Why not just provide a COM interface and cover both bases? COM can be called
> from .NET can't it?

It may be more work, but if that capability is important to you, you should
look into COM interop. Here are some relevant links:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cp
conexposingcomcomponentstonetframework.asp?frame=true

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cp
conbuildingcomcomponentsforinteroperability.asp

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cp
conruntimecallablewrapper.asp?frame=true


Signature

Doug Harrison
Microsoft MVP - Visual C++


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.