Convert Visual C++.NET to C# ?

I copied some code in C++ and compiled it using Microsoft's Visual Studio 2003, and I was wondering how difficult it would be to convert the project to C# ?
LVL 11
thunderchickenAsked:
Who is Participating?
 
Bob LearnedConnect With a Mentor Commented:
Difficult ;)

Bob
0
 
iboutchkineConnect With a Mentor Commented:
try Lutz Roeder Reflector
Reflector is a class browser for .NET components. It supports assembly and namespace views, type and
member search, C# XML documentation viewer, call and callee graphs, IL, VB and C# disassembler,
dependency trees, base type and derived type hierarchies and resource viewers. C#, Visual Basic and
Delphi language syntax is supported.

http://www.aisto.com/roeder/DotNet/


You can open your assembly in C++ and then convert it to C#
0
 
AlexFMConnect With a Mentor Commented:
You can wrap this code to C++/CLI library. Create C++/CLI Class Library, add class to it which exposes pure managed interface for C# client and internally calls legacy C++ code. There are no any restrictions on using unmanaged code in C++/CLI.
0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

 
thunderchickenAuthor Commented:
I guess I was hoping there was a magic tool, or MS conversion.  Doh!

It's pretty straight forward code anyway, so I'll just bite the bullet and do it manually.

Thanks
0
 
Bob LearnedCommented:
If you look up ^^^, there's an expert (AlexFM) who can really help you with the conversion, if you want. ;)

Bob
0
 
thunderchickenAuthor Commented:
Yea, I saw that, have it working, etc, but I was trying to avoid doing it that way.  The goal was to have everything together, instead of compiling seperate .dll's  :(
0
 
Bob LearnedCommented:
Can we see the C++ code, please?

Bob
0
 
thunderchickenAuthor Commented:
http://home.comcast.net/~tckerrigan/

It's basically this, but I've been modifying it over the past few weeks, but this is the meat and bones.  I was wanting to write my own from scratch, but curious how the C++ specific things would transfer to C#.NET, or even crappy VB.NET
0
 
Bob LearnedCommented:
The interesting thing that I have discovered is that C# 2005 can include C++ code without conversion.  I find that interesting to know.

Bob
0
 
thunderchickenAuthor Commented:
Well, this was the easiest example i could find to actually learn how to write my own chess engine.  This would just save me time to have it converted, but I'll learn much more by doing this line by line.  No big deal, that's what work lunch hours are for.
0
 
Bob LearnedCommented:
Well, my friend, if you need help, let us know.

Bob
0
 
anwar ul haqueCommented:
I think you are looking some tool to convert c++ syntax into c#, that is not available, I'm afradid you will have to do it manually.
0
 
anwar ul haqueCommented:
look at the accepted answer.....:D no wonder ppl will laugh ;)
0
 
thunderchickenAuthor Commented:
It was the best answer that summed up my 14 days of conversion.
0
 
anwar ul haqueCommented:
actually I'm NOT against your judgement but if you look at the visually accepted answer you will laugh.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.