473,499 Members | 1,721 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

C++ capability within C#

I have some background with C and C++ and am considering migration to Visual C#.NET for academic work. To get started, is it possible to compile working C++ code in the Visual C#.NET environment? If so, how is it done

Thanks in advance for any help.
Nov 15 '05 #1
3 1156
I assume that the existing C++ is unmanaged. Basically, C# cannot directly
call or consume native C++. However, Managed C++ can. It actually lets you
have unmanaged and managed in the same file! So what you can do is use MC++
to write a managed wrapper around your native C++. Then you can call it and
use it from C# (and any other CLR language). I did some articles on this a
while back for O'Reilly. See below. Its also in my book.

http://www.ondotnet.com/pub/a/dotnet...03/mcppp2.html

--
Sam Gentile [C#/.NET MVP]
..NET Blog http://samgentile.com/blog/
MSDN Column:
http://msdn.microsoft.com/library/de...tml/bridge.asp
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
"David H." <an*******@discussions.microsoft.com> wrote in message
news:A4**********************************@microsof t.com...
I have some background with C and C++ and am considering migration to Visual C#.NET for academic work. To get started, is it possible to compile
working C++ code in the Visual C#.NET environment? If so, how is it done?
Thanks in advance for any help.

Nov 15 '05 #2
I assume that the existing C++ is unmanaged. Basically, C# cannot directly
call or consume native C++. However, Managed C++ can. It actually lets you
have unmanaged and managed in the same file! So what you can do is use MC++
to write a managed wrapper around your native C++. Then you can call it and
use it from C# (and any other CLR language). I did some articles on this a
while back for O'Reilly. See below. Its also in my book.

http://www.ondotnet.com/pub/a/dotnet...03/mcppp2.html

--
Sam Gentile [C#/.NET MVP]
..NET Blog http://samgentile.com/blog/
MSDN Column:
http://msdn.microsoft.com/library/de...tml/bridge.asp
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
"David H." <an*******@discussions.microsoft.com> wrote in message
news:A4**********************************@microsof t.com...
I have some background with C and C++ and am considering migration to Visual C#.NET for academic work. To get started, is it possible to compile
working C++ code in the Visual C#.NET environment? If so, how is it done?
Thanks in advance for any help.

Nov 15 '05 #3

"David H." <an*******@discussions.microsoft.com> wrote in message
news:A4**********************************@microsof t.com...
I have some background with C and C++ and am considering migration to Visual C#.NET for academic work. To get started, is it possible to compile
working C++ code in the Visual C#.NET environment? If so, how is it done?
Nope -- that wont work -- While the C# language *may* be based somewhat on
C++, it's quite a different kettle of fish.

Your choices are at least these:
1) using managed VC++
2) leverage your C++ knowledge - and learn C#

Note : while C# is quite a different language, managed VC++ (for .Net
runtime environment) is somewhere in between - <grotesque>it ain't VC++ and
it ain't C#</grotesque>
regards
roy fine
Thanks in advance for any help.

Nov 15 '05 #4

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

Similar topics

5
15001
by: Salgoud Dell | last post by:
I have a project within which I need to send an automatically produced report to a client list. Can anyone point me to documentation on implimenting an email sending routine within a VB6 program?...
1
2369
by: Matt | last post by:
Hello, I would like to be able to delete (as in stdio.h remove()) fstream objects. Is there a means for me to do this in C++? I see no such capability in my references. remove() is not so...
0
275
by: Sri | last post by:
I am using PrintDocument to draw bar chart and I want to include the drill down capability. Is it possible? Please any one help me VB.Net coding
3
1683
by: Prabhat | last post by:
Hi All, I have IE6.0 SP1 and I executed one asp file with the below script to check the browser capability but see the result below the script...Copied from MSDN :) <% Set bc =...
1
2084
by: jobi.joy | last post by:
I have a requirement of having the capability of offline form filling for my website.So users can some way download the form and can fill out in offline mode. Any standard way to do this. I am...
1
1566
by: Eric Girouard | last post by:
Hi A web design client of mine has been developing an Access database with me for the last few months. His intention was to clean up a very messy paper-based workflow consisting of many location...
0
1219
by: BG | last post by:
i am thinking that creating datagrid at design time will save me a lot of time when creating programs. however, i ran into a brick wall. i created a template column at design time. i learned...
3
1299
by: Chris Lincoln | last post by:
I am currently working on a company site and have run into a problem with the search aspect of the site. I am running .net 2.0 and iis 5.1. The issue is as follows: Indexing Service is properly...
1
1804
by: mhsasono | last post by:
Hi all, Has anybody experienced with CrystalReport? My question is: Does CrystalReport have capability to print the Microsoft Word document? Reason: I want to know CrystalReport capability...
0
2428
by: passion | last post by:
"Specialized Search Engines" along with Google Search Capability (2 in 1): http://specialized-search-engines.blogspot.com/ Billions of websites are available on the web and plenty of extremely...
0
7128
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7006
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
7169
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
7385
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...
0
5467
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,...
1
4917
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...
0
3088
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1425
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
294
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.