Click here to Skip to main content
15,900,553 members
Please Sign up or sign in to vote.
2.50/5 (2 votes)
See more:
I'm in a bit of a jam here and need some help. I've got a C++ text economic space game that I wrote a while back and I now need to create a C# version of it with graphics and stuff. But I do not know enough C# yet to completely rewrite it. But someone had told me that there is a way to use C++ files and classes in a C# program, and that that would solve my problem until I learned enough to completely rewrite them in C#. But this friend never told me how exactly to do that. Could someone here please help me or give me some good suggestions? I would sure appreciate it, thanks.

Oh, and by the way, I'm using Microsoft Visual Studio 2008 and it's .net versions of C++ and C#.
Posted
Updated 15-Dec-10 16:18pm
v3

Actually it is very simple.
1. If your C++ code is old, unmanaged code, make a few necessary modifications in order for it to complile as c++.net code.
2. Make a dll out of it.
3. Simply add a reference to that dll in your new c#.net project. All of the code there will be accesible for use.
 
Share this answer
 
 
Share this answer
 
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900