views:

228

answers:

3

I've discovered VB2Py, but it's been silent for almost 5 years. Are there any other tools out there which could be used to convert VB6 projects to Python, Ruby, Tcl, whatever?

+3  A: 

I doubt there would be a good solution for that since VB6 relies too much on the windows API and VBRun libraries though you could translate code that does something else besides GUI operations

Is there something special you need to do with that code? You could compile your VB6 functionality and expose it as a COM object and connect it to python with IronPython or IronRuby which are Python and Ruby implementations in .Net thus, allowing you to access .Net functionality although im not quite sure if COM exposed objects are easily pluggable to those interpreters.

Maybe if you explain a bit more what you want to do you would get a wiser response.

Gustavo Rubio
+3  A: 

Compile the VB code either into a normal DLL or a COM DLL. All Pythons on Windows, including the vanilla ActivePython distribution (IronPython isn't required) can connect to both types of DLLs.

I think this is your best option. As Gustavo said, finding something that will compile arbitrary VB6 code into Python sounds like an unachievable dream.

Eli Bendersky
+1  A: 

Generally, Python is much, much more expressive than VB. Things which took many lines of code in VB can be represented more simply in Python.

If the VB is truly epic in scale, a manual rewrite may be hard. But maintaining VB6 may be just as hard.

If the VB is intimately tied to Windows GUI presentation, any rewrite may be hard. Some VB programs can have a cryptic organization where critical features are buried in the VB code attached to GUI controls.

If the VB is not very big and doesn't use mystery features of the GUI controls, it will probably be much simpler to rewrite the program and do a good job of refactoring the legacy code into something leaner and cleaner.

S.Lott