Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Convert old VB6 to C#

2 views
Skip to first unread message

Robert Bravery

unread,
Sep 9, 2008, 11:44:29 AM9/9/08
to
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

--
Web Development, Hosting, Design and Content Management Systems
http://www.integralwebsolutions.co.za

Anthony Jones

unread,
Sep 9, 2008, 12:08:06 PM9/9/08
to
"Robert Bravery" <m...@u.com> wrote in message
news:A75A3EF0-A72E-4FEF...@microsoft.com...

> 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#.

--
Anthony Jones - MVP ASP/ASP.NET

Alberto Poblacion

unread,
Sep 9, 2008, 12:12:41 PM9/9/08
to
"Robert Bravery" <m...@u.com> wrote in message
news:A75A3EF0-A72E-4FEF...@microsoft.com...
> 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.

Allen@discussions.microsoft.com Christopher Allen

unread,
Sep 9, 2008, 10:10:01 PM9/9/08
to
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.

Christopher Allen

unread,
Sep 9, 2008, 10:14:00 PM9/9/08
to
things. I meant things.

Jeff Gaines

unread,
Sep 10, 2008, 4:17:02 AM9/10/08
to
On 10/09/2008 in message
<E22BA7F8-B6A6-4196...@microsoft.com> Christopher Allen
wrote:

>things. I meant things.

Just a Freudian slip :-)

--
Jeff Gaines Damerham Hampshire UK
Tell me what you need, and I'll tell you how to get along without it.

DaveL

unread,
Sep 10, 2008, 10:52:10 AM9/10/08
to
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


"Robert Bravery" <m...@u.com> wrote in message
news:A75A3EF0-A72E-4FEF...@microsoft.com...

0 new messages