473,395 Members | 1,972 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,395 software developers and data experts.

Mixing C# and C++

Hi,

I will be starting a project that may need to use C# and C++ for different
parts of the project. What is the best way to go about this?

e.g which project type should i use and what issues do i need to look out for?

Thanks In Advance
Macca
Nov 17 '05 #1
2 1776
Macca,

What is the purpose of using C++? Do you really need it? I would use
..NET for most of the development, and dive down into C++ only when you need
it.

If you have pre-existing C++ classes which you want to use in .NET, then
you will have to create managed wrappers so that you can use them. Either
that, or make them into COM objects and use COM Interop to access them.

If you simply have functions that you have exported from DLLs then you
can just make those calls through the P/Invoke layer. If you have functions
in libs, then you will have to create a dll which exports those functions.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Macca" <Ma***@discussions.microsoft.com> wrote in message
news:F1**********************************@microsof t.com...
Hi,

I will be starting a project that may need to use C# and C++ for different
parts of the project. What is the best way to go about this?

e.g which project type should i use and what issues do i need to look out
for?

Thanks In Advance
Macca

Nov 17 '05 #2
apm


"Macca" <Ma***@discussions.microsoft.com> wrote in message
news:F1**********************************@microsof t.com...
Hi,

I will be starting a project that may need to use C# and C++ for
different
parts of the project. What is the best way to go about this?

e.g which project type should i use and what issues do i need to look out
for? The C# will have a C# project type. The C++.NET (is the C++ part C++.NET)
will have a C++.NET project type. Both project types will coexist in the
same Solution. You should also be able to use the debugger as if all were in
the same language. There aren't any special issues other than the fact that
the C++.NET is difficult to work with. It has better facilities for
interacting with the non .NET world, however. It may be best to do as much
in C# as you can.
Thanks In Advance
Macca


Nov 17 '05 #3

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

Similar topics

3
by: bergel | last post by:
Hello, Does anyone already have some experience in mixing AWT and Swing? Is it conceptually doable? Does the design of Swing prevent interaction between an AWT and a Swing widget? Regards,...
6
by: Russell E. Owen | last post by:
At one time, mixing for x in file and readline was dangerous. For example: for line in file: # read some lines from a file, then break nextline = readline() # bad would not do what a naive...
0
by: Erik Max Francis | last post by:
Is there any prohibition against mixing different protocols within the same pickle? I don't see anything about this in the Python Library Reference and, after all, the pickle.dump function takes a...
4
by: Rudolf | last post by:
Is it possible to add a vb.net source code module to a c# project and if so how? Thanks Rudolf
1
by: Marc Cromme | last post by:
I would like to ask a question about (good ?) style and possibilities in mixing C FILE* and C++ file streams. The background is that I want to use the C libpng library from within C++, but I...
4
by: Cristian Tota | last post by:
Hi, I'd appreciate any thoughts on mixing C++ and C code. I have a project that uses a given C interface, the rest of the project can be either in C or C++. What would be the recomended design...
2
by: Dan | last post by:
Hi What are the dangers of mixing asp and asp.net? For the .net part of the site i will need to use the global.asax file but for the asp parts it will be using the other global. file, is there...
0
by: dhruba.bandopadhyay | last post by:
I know that it's possible to mix ASP & ASP.NET 1.1 in the same website/application so long as they are in separate frames (iframes). This also holds for mixing ASP & ASP.NET 2.0 pages. But what I...
28
by: ziman137 | last post by:
Hello all, I have a question and am seeking for some advice. I am currently working to implement an algorithmic library. Because the performance is the most important factor in later...
3
by: jason | last post by:
I've been working with C# for over a year now without touching vb.net code. I had a few light years of vb.net before that. No real vb6 or windows form experience. Suddenly, I have an assignment...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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...

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.