Click here to Skip to main content
15,881,424 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have a project that was created using Visual C++ 2010 and I would like to know who to convert the sln (project file) from C++ to VB.net?
Posted
Comments
Dimhotepus 2-Jul-14 17:40pm    
Please, provide some info about the project:
+ What is the problem area of the solution?
+ What kinds of libraries / frameworks have you used?
+ Why do you want to rewrite it to .NET platform?
+ Is it possible to use C# instead of VB.NET?
+ What Visual Studio version do you want to use to work with rewritten project and what .NET Framework version and target machine configuration you are going to run on?

Hope it helps in further conversion work.
Sergey Alexandrovich Kryukov 2-Jul-14 17:44pm    
Good questions. Agree, but I already answered the way covering most of those issues, please see.
—SA
Keith O. Williams 2-Jul-14 19:24pm    
I am creating a browser using Visual Basic Professional 2010 and I had included a Games form in the project and on that form there is a list of games. I would like to add the Pong Clone project I got on the internet to my browser under the games form. However, the Pong Clone project is written in Visual C# 2010 and I would like to convert the project to Visual Basic.NET before adding it to my project. How I go about doing that?

My original post is wrong. The original code for the Pong Clong project is written in Visual C# not C++ or C++/CLI. Is conversion possible and if so, do I need to create an actual form and connect the menu class to it?

Like this:

Public Class FormScoontzPong

Private Property SPMenu As Object

Private Sub FormScoontzPong_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
SPMenu.Start()
End Sub
End Class
Richard MacCutchan 2-Jul-14 19:37pm    
You can include the project "as is", since VB.NET and C# both compile to the same object code.
Sergey Alexandrovich Kryukov 2-Jul-14 20:50pm    
You should have notified me about it in a comment to my answer. Please see the update.
—SA

1 solution

If this is C++ and not C++/CLI, there is no "conversion", it simply makes no sense: the languages target different no-isomorphic platforms. In practice, through out UI, use the original code only as a reference for creating a new one. Before even trying to do it, review your decision again: do you really want this "translation"? Especially do VB.NET? Does it worth it? What are you going to gain? Give yourself a reasonable doubt.

If this is C++/CLI and all the code is manageable, consider the problem is already solved. Build the project and then use the output assembly to reverse-engineer it to VB.NET (or C#) code. How? One perfect open-sourcer tool is ILSpy:
http://en.wikipedia.org/wiki/.NET_Reflector[^],
http://www.ilspy.net/[^].

You can reasonably expect excellent quality of reverse-engineered code, if the quality of original code was good enough.

The .NET Reflector mentioned in the first article where ILSpy is also referenced, can be even better, but it is not open source and you will have to pay for it. I wouldn't.

If your C++ project is the mixed-mode one (managed+unmanaged), try to use mixed approach. :-)

[EDIT]

In response to "My original post is wrong. The original code for the Pong Clong project is written in Visual C# not C++ or C++/CLI":

Both VB.NET and C# target .NET. You can freely reference the assembly written in C# in the project written in VB.NET and visa versa. Besides, the method based on ILSpy will work perfectly and will give you excellent quality of code.

—SA
 
Share this answer
 
v2

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