How to Convert VB6 code in C# is there any Translator Available | Newbie | | Join Date: Jan 2007
Posts: 1
| | |
Some time ago i have developed an application in VB6 now i want to use this application in C#, Can anyone tell me how can i conver VB6 code in C# code is there any Translator available? or first i have to convert VB6>VB.net and than from VB.net to C# what are the possibilites please help!
Thank You
Adnan Khan
| | Lives Here | | Join Date: Sep 2006
Posts: 12,070
| | | re: How to Convert VB6 code in C# is there any Translator Available Quote:
Originally Posted by AdnanKhan Some time ago i have developed an application in VB6 now i want to use this application in C#, Can anyone tell me how can i conver VB6 code in C# code is there any Translator available? or first i have to convert VB6>VB.net and than from VB.net to C# what are the possibilites please help!
Thank You
Adnan Khan You may need to post this in the C# forum as well.
|  | Moderator | | Join Date: Jan 2007 Location: Maine, USA
Posts: 2,904
| | | re: How to Convert VB6 code in C# is there any Translator Available
I don't know of any direct way, however, if the VB6 code works correctly, you could compile it as a DLL and add it to the references in your C# project.
| | Newbie | | Join Date: Jan 2007 Location: I don't know!
Posts: 12
| | | re: How to Convert VB6 code in C# is there any Translator Available
You might already have solved it, but anyway: SharpDevelop has a build in option to convert vb.net to c# and c# to vb.net (okay, it's for the .net framework, but if you back-up your code, you can always try...). (I have the program installed but never used the option... so don't know how good it works...)
Oh, it's a free program...
|  | Moderator | | Join Date: Jan 2007 Location: Maine, USA
Posts: 2,904
| | | re: How to Convert VB6 code in C# is there any Translator Available Quote:
Originally Posted by NH1 You might already have solved it, but anyway:
SharpDevelop has a build in option to convert vb.net to c# and c# to vb.net (okay, it's for the .net framework, but if you back-up your code, you can always try...). (I have the program installed but never used the option... so don't know how good it works...)
Oh, it's a free program... That's cool, except the question was about VB6.
| | Newbie | | Join Date: Feb 2007 Location: New York, NY
Posts: 1
| | | re: How to Convert VB6 code in C# is there any Translator Available Quote:
Originally Posted by Motoma That's cool, except the question was about VB6. There is no easy way to "convert" from VB6 to any .Net Language. Since VB.Net is an object oriented language and VB6 is a linear language, you actually have to rewrite it.
The simplest thing to do is create one class in VB.Net and translate all of your VB6 functions into it. This is not easy and requires knowledge of VB.Net and the difference in syntax between VB6 and VB.Net
However, once its in VB.Net there are a few tools (e.g. SharpDevelop) that will translate to C# or other .Net languages (also not always perfectly and may require some manual fixes.)
|  | Moderator | | Join Date: Jan 2007 Location: Maine, USA
Posts: 2,904
| | | re: How to Convert VB6 code in C# is there any Translator Available Quote:
Originally Posted by genji There is no easy way to "convert" from VB6 to any .Net Language. Since VB.Net is an object oriented language and VB6 is a linear language, you actually have to rewrite it.
The simplest thing to do is create one class in VB.Net and translate all of your VB6 functions into it. This is not easy and requires knowledge of VB.Net and the difference in syntax between VB6 and VB.Net
However, once its in VB.Net there are a few tools (e.g. SharpDevelop) that will translate to C# or other .Net languages (also not always perfectly and may require some manual fixes.) Welcome to The Scripts genji.
| | Expert | | Join Date: Jan 2007 Location: Wisconsin, USA
Posts: 83
| | | re: How to Convert VB6 code in C# is there any Translator Available
The fruits of my Google search:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vboriUpgradingFromVisualBasic60.asp
http://sharptoolbox.com/categories/code-converters-language-migration
http://www.artinsoft.com/pr_vbcompanion.aspx
From MSDN:
"Visual Basic .NET enables a fundamental shift from traditional Windows development to building next-generation Web and n-tier applications. For this reason, your code will need to be upgraded to take advantage of Visual Basic .NET.
"This happens automatically when you open a Visual Basic 6.0 project in Visual Basic .NET: the Upgrade Wizard steps you through the upgrade process and creates a new Visual Basic .NET project (your existing project is left unchanged). This is a one-way process; the new Visual Basic .NET project cannot be opened in Visual Basic 6.0."
There are some changes you will have to make before and after, however. It will definitely be work if you have lots of code.
|  | Moderator | | Join Date: Nov 2006 Location: Upstate NY - US
Posts: 2,268
| | | re: How to Convert VB6 code in C# is there any Translator Available
This may not be what you want, but I was excited to found out another possibility for work. If you are interested in Java, and I will understand if you do not, you may consider converting to it, see if you like the results; for a certain amount of moola that is. Please understand I have yet to try this for work projects. My boss, hoeve, is very elated about the change since most of our applications are written in Java, I just happen to like VB more. Anyway, here:
http://www.diamondedge.com/products/Convert-VB-to-Java.html
http://www.google.com/search?hl=en&q=Convert+VB+6.0+app+to+java
Give both links a look. In a bit!
Dököll
| | Newbie | | Join Date: Mar 2007
Posts: 1
| | | re: How to Convert VB6 code in C# is there any Translator Available
Try this tool
http://www.e-iceblue.com/transking/faq.htm
Best Regards
wjack
| | Newbie | | Join Date: Apr 2007
Posts: 1
| | | re: How to Convert VB6 code in C# is there any Translator Available Quote:
Originally Posted by NH1 You might already have solved it, but anyway: SharpDevelop has a build in option to convert vb.net to c# and c# to vb.net (okay, it's for the .net framework, but if you back-up your code, you can always try...). (I have the program installed but never used the option... so don't know how good it works...)
Oh, it's a free program... Does SharpDevelop work for the CompactFramework as well?
Thanks
| | Newbie | | Join Date: Oct 2009
Posts: 1
| | | re: How to Convert VB6 code in C# is there any Translator Available
Good web site to convert from Vb to C#
<link removed: not working>
|  | Site Moderator | | Join Date: Oct 2006 Location: The Great White North
Posts: 5,131
| | | re: How to Convert VB6 code in C# is there any Translator Available
Here is a a website that helps compare/translate VB.NET -> C#: VB.NET and C# Comparison |  | | | | /bytes/about
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over 226,449 network members.
|