By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,160 Members | 1,323 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,160 IT Pros & Developers. It's quick & easy.

.NET 2.0: code conversion from VB6 to C#

P: n/a
Hello
I have a question to .NET programmers about code conversion from VB6
to C#.NET: is it possible? how much work must be performed manually?
Thank you very much for your answers.
/RAM/
PS. By the way, how about other languages like C++, C, Delphi, etc.?
May 15 '06 #1
Share this Question
Share on Google+
7 Replies


P: n/a
Not having ever done it, I am guessing quite a bit of work.

However, it will be worth it if you do it right. Don't just do straght port,
think about how to take advantage of OO, the framework itself, etc. It might
mean restructuring your whole program.

"R.A.M." <r_********@poczta.onet.pl> wrote in message
news:13********************************@4ax.com...
Hello
I have a question to .NET programmers about code conversion from VB6
to C#.NET: is it possible? how much work must be performed manually?
Thank you very much for your answers.
/RAM/
PS. By the way, how about other languages like C++, C, Delphi, etc.?

May 15 '06 #2

P: n/a
R.A.M. <r_********@poczta.onet.pl> wrote:
PS. By the way, how about other languages like C++, C, Delphi, etc.?


C++, C can be compiled possibly with some modification using C++/CLI.

Delphi can be compiled to .NET (currently 1.1 only) with the latest
versions of Delphi (E.g. BDS 2006).

-- Barry
May 15 '06 #3

P: n/a

It is not Trivial.

One error of alot of code rework:***

ADO (adodb) has been replaced with ADO.NET.

Minus the name, they have nothing in common.

What the conversion tool will do is ... rewrite the adodb stuff in dotnet
syntax.
However, it will refernce the adodb. com object.

This is a fudge patch. Its saying "I'm going to keep using the old com
object.. and not give you the code/advantage of the new ado.net stuff".

Is it possible? Yeah.

Is it seemless. No way.
I'd suggest finding someone who's been thru it to show you personally whats
going on.

You'll bite off more than you can chew, if you don't get some good advice.
***
There is alot an issue with how well you designed your vb app. If its
spaghetti'ed together, then you'd be best to rewrite the
requirements/business rules and start from scratch.

If you had good layers (Presentation, BusinessLogic, DataLayer ), then you
have a fighting chance.

...

This is just my opinion, since I had to do this once.
Now, I refuse to put "VB6" on my resume, for fear of re-doing that mess
again.


"R.A.M." <r_********@poczta.onet.pl> wrote in message
news:13********************************@4ax.com...
Hello
I have a question to .NET programmers about code conversion from VB6
to C#.NET: is it possible? how much work must be performed manually?
Thank you very much for your answers.
/RAM/
PS. By the way, how about other languages like C++, C, Delphi, etc.?

May 15 '06 #4

P: n/a
"R.A.M." <r_********@poczta.onet.pl> wrote in message
news:13********************************@4ax.com...
I have a question to .NET programmers about code conversion from VB6
to C#.NET: is it possible? how much work must be performed manually?
Thank you very much for your answers.


There is no conversion from VB6 to C# - don't let anyone con you into
thinking there is.

VB6 and C# are syntactically very different, but that is completely
irrelevant. It is the fact that VB6 runs on the Visual Basic runtime
libraries and C# runs on the .NET Framework which is the major point here.
The two aren't similar in any way - not even remotely.

If you want to turn your VB6 app into a C# app, use the VB6 app as your
prototype, and begin the C# development from scratch.
May 15 '06 #5

P: n/a
I think that despite the feedback of the others, this should be
straightforward. It will require four steps:

1. Migrate from VB6 to VB.NET. (Click da button.) Visual Studio comes with a
translator for this, and VB2005's translator is much better than VB.NET's.
2. Clean up migration failure points. You will have less of these if you
avoided COM objects, Variants, and default properties.
3. Migrate from VB.NET to C#. (Click da button.) You will need to find a
translator for this.
4. Clean up migration failure points. Since VB.NET is feature-comparable to
C# and VB.NET theoretically has a few stricter migration requirements since
it doesn't support case sensitivity, etc., I think there will be very few
failure points here.

You *can* use ADO classic and if you're just trying to get your stuff to
execute in the C# environment rather than the VB6 environment then a direct
port (or double-port rather) as described here should get you under way. You
can then go back and rewrite your database code with ADO.NET and replace
your other COM objects with managed equivalents.

Good luck.

--
Jon Davis

"R.A.M." <r_********@poczta.onet.pl> wrote in message
news:13********************************@4ax.com...
Hello
I have a question to .NET programmers about code conversion from VB6
to C#.NET: is it possible? how much work must be performed manually?
Thank you very much for your answers.
/RAM/
PS. By the way, how about other languages like C++, C, Delphi, etc.?

May 16 '06 #6

P: n/a
It's not that bad - we have had experience with upgrading VB6 to VB.NET and
converting VB.NET to C# on large projects and our metrics were about 15,000
LOC/week for VB6 to VB.NET (using the wizard + many manual adjustments), and
about 50,000 LOC/week for VB.NET to C# conversion (using our Instant C#
VB.NET to C# converter and some manual adjustments).
--
David Anton
www.tangiblesoftwaresolutions.com
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: C# to C++ converter & VB to C++ converter
Instant J#: VB to J# converter

"R.A.M." wrote:
Hello
I have a question to .NET programmers about code conversion from VB6
to C#.NET: is it possible? how much work must be performed manually?
Thank you very much for your answers.
/RAM/
PS. By the way, how about other languages like C++, C, Delphi, etc.?

May 16 '06 #7

P: n/a


"Jon Davis" <jo*@REMOVE.ME.PLEASE.jondavis.netwrote in message
news:O4**************@TK2MSFTNGP05.phx.gbl...
>
I think that despite the feedback of the others, this should be
straightforward. It will require four steps:

1. Migrate from VB6 to VB.NET. (Click da button.) Visual Studio comes with
a
translator for this, and VB2005's translator is much better than VB.NET's.
This migration doesn't work for anything more complex than Hello, World. It
works for small sections of code, but forget about it for applications.
2. Clean up migration failure points. You will have less of these if you
avoided COM objects, Variants, and default properties.
By the time you've completed this step - you could have completely rewritten
the app in either VB.Net or C#.
3. Migrate from VB.NET to C#. (Click da button.) You will need to find a
translator for this.
4. Clean up migration failure points. Since VB.NET is feature-comparable
to
C# and VB.NET theoretically has a few stricter migration requirements
since
it doesn't support case sensitivity, etc., I think there will be very few
failure points here.

You *can* use ADO classic and if you're just trying to get your stuff to
execute in the C# environment rather than the VB6 environment then a
direct
port (or double-port rather) as described here should get you under way.
You
can then go back and rewrite your database code with ADO.NET and replace
your other COM objects with managed equivalents.

Good luck.

--
Jon Davis

"R.A.M." <r_********@poczta.onet.plwrote in message
news:13********************************@4ax.com...
Hello
I have a question to .NET programmers about code conversion from VB6
to C#.NET: is it possible? how much work must be performed manually?
Thank you very much for your answers.
/RAM/
PS. By the way, how about other languages like C++, C, Delphi, etc.?
Mike Ober.

Jul 7 '06 #8

This discussion thread is closed

Replies have been disabled for this discussion.