473,386 Members | 1,803 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

.NET 2.0: code conversion from VB6 to C#

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
7 4804
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
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

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
"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
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
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


"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Aakash Bordia | last post by:
Hello, Does anybody know what is the documented and known behavior of inserting/updating binary columns using host variables from a client to a server which have different code pages? Will any...
5
by: Darren Grant | last post by:
Hi there, I've attempted to implement an Angle class. An Angle is a subset of an integer, where the range is [0,360). All other operations should be permitted. The code works, I think......
13
by: Christopher Benson-Manica | last post by:
This is intended to be a simple version of the Unix "head" command, i.e. a utility that displays the first n lines of a file. Comments welcomed... #include <cstdlib> #include <iostream>...
4
by: yanyo | last post by:
hi, im trying to figure out whats the problem with this program i get a runtime error but i dont see where the problem is i tried changing declaration but nothing if somrbody can try this on their...
11
by: Steve Gough | last post by:
Could anyone please help me to understand what is happening here? The commented line produces an error, which is what I expected given that there is no conversion defined from type double to type...
2
by: Alex Sedow | last post by:
Why explicit conversion from SomeType* to IntPtr is not ambiguous (according to standart)? Example: // System.IntPtr class IntPtr { public static explicit System.IntPtr (int); public...
3
by: nan | last post by:
Hi All, I am trying to connect the Database which is installed in AS400 using DB2 Client Version 8 in Windows box. First i created the Catalog, then when i selected the connection type...
7
by: dtecmeister | last post by:
Looking to see how many people could use this kind of tool. I've got several large databases I've developed in Access with MySQL as the back-end. I've started using Linux instead of windows and...
6
by: =?Utf-8?B?bWljaGFlbCBzb3JlbnM=?= | last post by:
Yesterday Visual Studio gave me a strange error both at compiletime and at designtime that had no obvious connection to anything I had changed recently. After some effort tracking down the problem...
2
by: Netwatcher | last post by:
Hello, i am new to c++ windows and DX programming, i encountered a code in the book stated in the title, which doesn't work for a reason, here is the code // Beginning Game Programming // Chapter...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.