As far as I know, there's no way to convert directly from VB6 to C#, and
probably never will be -- the languages are just too different. It's hard
enough to convert from VB6 to VB.Net.
You could theoretically use the VB upgrade wizard to convert from VB 6 to
VB.Net, and then use one of several third-party VB.Net to C# conversion
utilities. (Try searching the Microsoft newsgroups through
groups.google.com with "VB C# convert OR conversion".)
However, this would be a downright ugly solution. The VB upgrade wizard
itself is a kludge -- it produces code that has a hackish quality, and
depends on the VB Compatability library (a library of functions that exist
solely for backwards compatability with legacy code.) Further, it won't be
able to convert everything, so you'll have to clean up the code just to get
it to compile. Then, after you get this code to compile, you'll have to do
a _second_ conversion from VB.Net to C#, with a second code cleanup. This
would be a mess to debug and maintain.
Some alternatives:
1. Don't convert at all. Stick with VB6 for existing applications.
2. Leave the existing code as a class library in VB6, and use C# for your
new development. The C# application can then call the VB6 procedures and
functions through COM interop. (For example, you could build a new
front-end with Windows Forms using C#, but using the legacy code for the
back-end.)
3. Convert your existing code base only to VB.Net, and develop new code
in C# in a second assembly. This would eliminate one step in the
translation project, plus possibly be easier to maintain. (The code would
look more like the old VB6 code.) As an alternative, don't rule out
VB.Net -- it can do almost anything that C# can do, with equal performance.
4. Rewrite the code by hand in C#, and possibly give it a good cleaning
up in the process.
Hope this helps,
Robert Jacobson
"Corrie Taljaard" <ct (AT) rmtech (DOT) co.za> wrote
Quote:
Hi all,
Is it possible to upgrade a VB6 application to a C# application in dot
net?
Is the only option to upgrade to VB.NET?
Thanks in advance
--
C Taljaard
R&M Technologies CC
Tel : +27 (0) 12 6616316 (w)
+27 (0) 82 4523254 (m)
Fax: +27 (0) 12 6616315 |