Connecting Tech Pros Worldwide Forums | Help | Site Map

How to Convert VB6 code in C# is there any Translator Available

Newbie
 
Join Date: Jan 2007
Posts: 1
#1: Jan 15 '07
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
#2: Jan 16 '07

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.
Motoma's Avatar
Moderator
 
Join Date: Jan 2007
Location: Maine, USA
Posts: 2,904
#3: Jan 18 '07

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.
NH1 NH1 is offline
Newbie
 
Join Date: Jan 2007
Location: I don't know!
Posts: 12
#4: Jan 30 '07

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...
Motoma's Avatar
Moderator
 
Join Date: Jan 2007
Location: Maine, USA
Posts: 2,904
#5: Jan 31 '07

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
#6: Feb 1 '07

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.)
Motoma's Avatar
Moderator
 
Join Date: Jan 2007
Location: Maine, USA
Posts: 2,904
#7: Feb 1 '07

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
#8: Feb 3 '07

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.
Dököll's Avatar
Moderator
 
Join Date: Nov 2006
Location: Upstate NY - US
Posts: 2,268
#9: Feb 3 '07

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
#10: Mar 23 '07

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
#11: Apr 23 '07

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
#12: Oct 8 '09

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>
Frinavale's Avatar
Site Moderator
 
Join Date: Oct 2006
Location: The Great White North
Posts: 5,131
#13: Oct 20 '09

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
Reply


Similar Misc bytes