473,396 Members | 2,089 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

migrating unmanaged C++ classes to provide VB interface

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.
Nov 17 '05 #1
3 1188
On Thu, 12 May 2005 13:55:00 -0700, Brett wrote:
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.


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.

--
Doug Harrison
Microsoft MVP - Visual C++
Nov 17 '05 #2
"Doug Harrison [MVP]" <ds*@mvps.org> wrote in message
news:mv*****************************@40tude.net...
On Thu, 12 May 2005 13:55:00 -0700, Brett wrote:
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.


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
Nov 17 '05 #3
On Fri, 13 May 2005 10:15:27 -0700, Brett wrote:
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/de...asp?frame=true
http://msdn.microsoft.com/library/de...perability.asp
http://msdn.microsoft.com/library/de...asp?frame=true

--
Doug Harrison
Microsoft MVP - Visual C++
Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Brett | last post by:
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...
6
by: Shai Levi | last post by:
Hi, I'm trying to migrate native c++ class to managed c++ class. The native class header definition looks as: class NativeClass { public: typedef void (CbFunc1)(int n,void* p);
1
by: Steve | last post by:
We are considering the ways to migrate our VC++ 6.0 applications to .NET platform. It would be nice to rewrite them completely in C#, but due to the time constraints this option is out of...
0
by: Lokkju | last post by:
I am pretty much lost here - I am trying to create a managed c++ wrapper for this dll, so that I can use it from c#/vb.net, however, it does not conform to any standard style of coding I have seen....
3
by: nikola | last post by:
is it possible to export (and, above all, import afterwards) an unmanaged class from a managed dll (compiled with the /clr switch. it would in fact probably result in a mixed mode dll)? it seems that...
7
by: yaron | last post by:
Hi, if i have the unmanaged c++ source files, what is the easy way to provide c# interface to this unmanaged c++ dll, should i use managed c++ wrapper classes or use PInvoke or use the /clr...
9
by: Amit Dedhia | last post by:
Hi All I have a VC++ 2005 MFC application with all classes defined as unmanaged classes. I want to write my application data in xml format. Since ADO.NET has buit in functions available for...
2
by: Jon Slaughter | last post by:
How difficult is it for one to integrate unmanaged C++ into C#? I know for functions one can use DLLimport but how does one go about doing it for classes? Do I have to completely reimplement the...
5
by: ttc | last post by:
Hi All, I have a managed class that inherits from an unmanged class. The question is, if the object of the manged class get garbage collected, will the memory be free automatically for me or...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.