Click here to Skip to main content
15,178,226 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
AnswerRe: What C# tools do you recommend? Pin
Eddy Vluggen9-Nov-17 7:04
professionalEddy Vluggen9-Nov-17 7:04 
AnswerRe: What C# tools do you recommend? Pin
RedDk9-Nov-17 11:07
MemberRedDk9-Nov-17 11:07 
GeneralRe: What C# tools do you recommend? Pin
ThePhoenyx10-Nov-17 8:40
MemberThePhoenyx10-Nov-17 8:40 
GeneralRe: What C# tools do you recommend? Pin
tbim10-Nov-17 4:00
Membertbim10-Nov-17 4:00 
AnswerRe: What C# tools do you recommend? Pin
m0sa10-Nov-17 0:09
Memberm0sa10-Nov-17 0:09 
GeneralRe: What C# tools do you recommend? Pin
tbim10-Nov-17 4:06
Membertbim10-Nov-17 4:06 
AnswerRe: What C# tools do you recommend? Pin
Robert Chafer10-Nov-17 1:25
MemberRobert Chafer10-Nov-17 1:25 
AnswerRe: What C# tools do you recommend? Pin
clemenslinders10-Nov-17 3:26
Memberclemenslinders10-Nov-17 3:26 
LS,

I converted a few VB6 programs to C# and some more from VB.NET.

When I joined the firm that I am currently working for they had a bunch of VB6 and VB.Net software and they wanted this translated to C# asap.

Ofcourse the best way is to start all over, but that was not an option my boss wanted (and he is the boss so he decides).

So I used VS2008 (it has a wizard for this) to translate VB6 into VB.NET.(Google will tell you how, but it is pretty straight forward).

And for the VB.NET programs I used SharpDevelop 4.4 (make sure to use this version and NOT a newer version, because for some reason the took the convert option out).

SharpDeveloper 4.4 (I am sure using google you can find this free software) has an option to convert VB.Net to C#. Load the VB.NET solution in SharpDevelop. Right click the solution and click Convert => C# (it has other convert options as well).

You will find that is not perfect. A lot of times you will need to replace brackets like ( with [. Strings in VB.Net start counting from 1 in C# this is 0 (if you didn't use VS2008's wizard to convert from VB6 to VB.Net than you need to keep this in mind).

You will need to create new screens (you can select everything and copy this to a new screen) and than make sure that the code is bound to this screen. You will also need to select for instance your buttons and select the correct click event to the click event of this button.

Than when you compile there will be some references to some VB.NET stuff that cause an error which you will need to remove.

Start with a simple project. If need be create a helloworld in VB6 and convert thus.

I used these options to convert about 15 projects to C# and it saved us a lot of time.

You will get the hang of it as to where you will need to make changes, in most cases it is the same kind of stuff that goes wrong.

You will also find that VB.NET is a lot more forgiving than C#. When you work with a database and retrieve info, there will not be a conversion to string. And when you use this method you will sonn find out that you need to go through the code and add '.ToString()' when you collect info from a database.

There are function in VB that have no counterpart in C# (if I am not mistaken Mid or MidStr is such a function). SharpDevelop will add some DLL so that you can still use these functions.

As the majority of the applications already was in VB.Net I am not sure if there are many functions in VB6 that do not have a counterpart in VB.Net. I do not think it will be that many.

However should this occur, lets say it is function GetCoffee() (I am pretty sure VB.Net does not have this function), than it will be converted to VB.NET there will be a comment line that this cannot be converted. SharpDevelop will also keep the code as it is.

Compiling the code will ofcourse produce an error at GetCoffee(). You can than use Google to see what this function does and simply create your own interpretation and write a new method.


I hope I was able to help you.




Kind regards,




Clemens Linders
AnswerRe: What C# tools do you recommend? Pin
ClockMeister10-Nov-17 5:21
professionalClockMeister10-Nov-17 5:21 
AnswerRe: What C# tools do you recommend? Pin
Thornik10-Nov-17 10:02
MemberThornik10-Nov-17 10:02 
GeneralRe: What C# tools do you recommend? Pin
Slow Eddie10-Nov-17 10:36
professionalSlow Eddie10-Nov-17 10:36 
GeneralRe: What C# tools do you recommend? Pin
Thornik10-Nov-17 12:52
MemberThornik10-Nov-17 12:52 
AnswerRe: What C# tools do you recommend? Pin
MAIsw12-Nov-17 22:20
MemberMAIsw12-Nov-17 22:20 
AnswerRe: What C# tools do you recommend? Pin
ElHori14-Nov-17 23:56
MemberElHori14-Nov-17 23:56 
GeneralFakir news, even if it's true Pin
W Balboos, GHB9-Nov-17 3:18
mveW Balboos, GHB9-Nov-17 3:18 
GeneralRe: Fakir news, even if it's true Pin
CodeWraith9-Nov-17 3:27
MemberCodeWraith9-Nov-17 3:27 
GeneralRe: Fakir news, even if it's true Pin
W Balboos, GHB9-Nov-17 3:28
mveW Balboos, GHB9-Nov-17 3:28 
GeneralRe: Fakir news, even if it's true Pin
CodeWraith9-Nov-17 3:32
MemberCodeWraith9-Nov-17 3:32 
GeneralRe: Fakir news, even if it's true Pin
User 48350479-Nov-17 3:55
MemberUser 48350479-Nov-17 3:55 
GeneralRe: Fakir news, even if it's true Pin
BillWoodruff9-Nov-17 7:43
mveBillWoodruff9-Nov-17 7:43 
GeneralRe: Fakir news, even if it's true Pin
W Balboos, GHB9-Nov-17 8:10
mveW Balboos, GHB9-Nov-17 8:10 
GeneralNot very busy in here today Pin
Keith Barrow9-Nov-17 3:07
professionalKeith Barrow9-Nov-17 3:07 
GeneralRe: Not very busy in here today Pin
W Balboos, GHB9-Nov-17 3:13
mveW Balboos, GHB9-Nov-17 3:13 
GeneralRe: Not very busy in here today Pin
CodeWraith9-Nov-17 3:23
MemberCodeWraith9-Nov-17 3:23 
GeneralRe: Not very busy in here today Pin
jeron19-Nov-17 5:03
Memberjeron19-Nov-17 5:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.