Convert old VB6 to C#

R

Robert Bravery

HI all,

Can someone point me in the right direction. I am looking for the fastet and
simplest way of converting a vb6 project, written by someone else (I am
takeing over the project) to C#

Thanks
Robert
 
A

Anthony Jones

Robert Bravery said:
HI all,

Can someone point me in the right direction. I am looking for the fastet
and
simplest way of converting a vb6 project, written by someone else (I am
takeing over the project) to C#

These are sooo different. My advice would be to document what the
application is doing and build from scratch. OR convert to VB.NET with all
the VB6 helper sugar you can find. Then convert it piece by piece to C# or
not bother just take out the VB6 sugar until its more akin to proper
framework code. Write new stuff in C#.
 
A

Alberto Poblacion

Robert Bravery said:
Can someone point me in the right direction. I am looking for the fastet
and
simplest way of converting a vb6 project, written by someone else (I am
takeing over the project) to C#

You could do a two-step conversion: First open the project in Visual
Studio, which will convert it into VB.Net. Then convert the VB.net code into
C# by means of the various code converters available, such as the one
available from http://www.vbconversions.net/. However, it will still require
a lot of manual attention, unless it is a trivial program, since there are
many incompatibilities between the laguages involved.
 
C

Christopher Allen

Try to avoid falling for something that's kind a noob 'duh', but has caught
me before when converting from VB to C#

The indices in VB start at 1, not 0 like C#. (Which is more C-like, amongst
other thongs.)
So, if you have a substring method that is indexed at 1 in VB, convert it to
0 in C#, or you're going to get some absurd string errors, including an
attempt to snatch up parts of the string that don't exist.

Yes, I know it's simple, but man has it messed me up before because I forgot
to catch it.
 
C

Christopher Allen

things. I meant things.

Christopher Allen said:
Try to avoid falling for something that's kind a noob 'duh', but has caught
me before when converting from VB to C#

The indices in VB start at 1, not 0 like C#. (Which is more C-like, amongst
other thongs.)
So, if you have a substring method that is indexed at 1 in VB, convert it to
0 in C#, or you're going to get some absurd string errors, including an
attempt to snatch up parts of the string that don't exist.

Yes, I know it's simple, but man has it messed me up before because I forgot
to catch it.
 
D

DaveL

Ive Had to Convert Vb6 Code to c#

For Me know the overall strategy of the app
build ur c# program based on the old app
(no major logic) just the regular stuff most apps contain
windows client (Midi, Menus, Dialogs)

then one project in one window, and the other in another window, 2 monitors
makes it nice..

Read the Vb6 Code and Write new Classes in c#

You'll Find you will have a more robust program, since vb6 is a wanna be
class language (not)

Services
Build a Service with or without multithreading (completed service with all
the bells and whistles you need)

Then Convert the vb Business logic to c#

Web Backend Dlls
Clean up the UI, Redo the Dlls,

doing conversion like the above , ino its a mental pain in the Arse, but
once u get into it, you'll find that you will
be able to throw away so much code its unbelievable

good luck
Dave
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top