473,765 Members | 1,987 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Create a .NET interface to C++ classes

Hello

I have written all code for a client server application in C++. It is
standard C++ written using Visual Studio v6. Basically C++ and STL.

I want to provide a .NET interface for those developers who use vb.net, C#,
etc.

Can anyone give me some pointers as to how to get started. Do I need to
purchase the .NET Visual Studio? How much .NET will I need to learn? Any
resources on how to write a .NET wrapper around C++ classes?

Angus

p.s. If there are more appropriate newsgroups please let me know.
Jun 27 '08 #1
2 1426
Angus wrote:
Hello

I have written all code for a client server application in C++. It is
standard C++ written using Visual Studio v6. Basically C++ and STL.

I want to provide a .NET interface for those developers who use vb.net, C#,
etc.

Can anyone give me some pointers as to how to get started. Do I need to
purchase the .NET Visual Studio? How much .NET will I need to learn? Any
resources on how to write a .NET wrapper around C++ classes?
There are several possible solutions:

AFAIK you can use the free Visual C++ Express edition, but I couldn't
figure out if this compiler supports C++/CLI (the C++ .NET extensions),
otherwise you would have to purchase the edition supporting it.
By the way the name Visual C++ .NET is somewhat misleading, since it's
still a native C++ compiler, with some .NET extensions.

You should at least have some basic knowledge about .NET. Memory
handling, .NET framework and the basic data structures / lists. etc.
Additionally you should have a good knowledge about C++/CLI - a standard
ized extension for C++ to access / provide access for .NET.

I would suggest you to start with C# (free express edition available)
and play around with the .NET framework, to get familiar with the
framework and garbage collection. You have to use C# anyways to check
your C++/CLI wrappers.

After that you should get familiar with C++/CLI, which you will use to
wrap your native C++ classes.
You may have a look at STL/CLR (the .NET compatible implementation of
the STL) too.

Hope this helps to start.

Angus

p.s. If there are more appropriate newsgroups please let me know.
Andre
Jun 27 '08 #2

"Angus" <no****@gmail.c omha scritto nel messaggio
news:ed******** ******@TK2MSFTN GP04.phx.gbl...
I have written all code for a client server application in C++. It is
standard C++ written using Visual Studio v6. Basically C++ and STL.

I want to provide a .NET interface for those developers who use vb.net,
C#,
etc.
In addition to the other reply:

If you don't want to use an IDE/compiler that supports C++/CLI (like VS2005
or VS2008), and you want to continue using VC6, you may build a COM wrapper
to your existing C++ code.

VC6 supports COM development, using both ATL and MFC (I don't know about
your code details, but I would suggest using ATL to make a thin COM wrapper
on your existing C++ code).

VB.NET and C# can use COM objects.

Giovanni
Jun 27 '08 #3

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

Similar topics

4
3741
by: Clint Hill | last post by:
I am working on a project that I would like to have some extensibility for later. So with this I am using interfaces to pass objects to derived classes. However I am running into a situation where two seperate classes won't cast each other even though they implement the same interface. The classes are identical yet won't convert. Here is (briefly) what I am talking about: public interface IReturnObject { Guid ID { get; set; } string...
9
4649
by: Anon Email | last post by:
Hi people, I'm learning about header files in C++. The following is code from Bartosz Milewski: // Code const int maxStack = 16; class IStack
20
4262
by: Ole Hanson | last post by:
I am accessing my database through an interface, to allow future substitution of the physical datastore - hence I would like to declare in my Interface that my DAL-objects implementing the interface and accessing the datastore MUST pass in a UserToken in the constructor of the object. Is this not possible? Am I forced to add the UserToken as a property on the object instead? /Ole
10
2979
by: Brett | last post by:
I'm still trying to figure out concrete reasons to use one over the other. I understand the abstract class can have implementation in its methods and derived classes can only inherit one abstract class. The interface has implied abstract methods/properties and derived classes can inherit multiple interfaces. The interface properties/methods have no implementation. Besides definitions of the two, what are some conceptual reasons to use...
1
5684
by: News User | last post by:
This may sound stupid but I am having trouble figuring out this one. Any help would be appreciated. I have 3 classes ClassA & ClassB and ClassC From ClassC I would instantiate ClassA ClassA inturn uses/ instantiates ClassB I would like to create a variable in ClassA that can be accessed from both
7
1775
by: Ron | last post by:
Hello, I have 4 classes that use 4 DTS packages on 4 different tables. So I have Dim cls1 As New clsDTS1, cls2 As New clsDTS2 Dim cls3 As New clsDTS3, cls4 As New clsDTS4 Each class has a common property called DataPath cls1.DataPath = strPath
7
1426
by: Brett | last post by:
I have created an interface with five properties and five methods. Five classes are accessed through this interface and contain the implementation. This setup works fine now. All the classes are encapsulated by the interface. If one of the classes requires a new method, this means I have to add this method to the interface and all involved classes. My design breaksdown in this case and becomes high maintenance. Is there a better...
13
2426
by: docschnipp | last post by:
Hi, I have a bunch of object derived from the same base class. They all share the same constructor with some parameters. Now, instead of using a large switch() statement where I call every single Object by itself, I'd like to assign a reference to the class type and call it later without knowing the derived type. Example:
15
2803
by: Xah Lee | last post by:
On Java's Interface Xah Lee, 20050223 In Java the language, there's this a keyword “interface”. In a functional language, a function can be specified by its name and parameter specs. For example: f(3) f(3, )
2
5566
by: Joseph Geretz | last post by:
When I create a Form, the VB IDE creates the following files in the following hierarchy: Form1.cs Form1.Designer.cs Form1.resx Both Form1.cs and Form1.Designer.cs are partial implementations of a single physical class definition. The VB IDE properly recognizes Form1.cs as a Form (i.e. double-clicking opens the Form designer). It also recognizes
0
9399
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
9955
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9833
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8831
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 projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7378
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6649
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5275
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5421
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3531
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.