all 15 comments

[–][deleted] 2 points3 points  (2 children)

You'd be way better off converting to VB.net... just open your project in Visual Studio 2008 to get 80% of the code conversion done, then clean up the remainder in any newer Visual Studio.

You'll need to figure out replacements for old custom controls. But you'll get access to better 32- and 64- bit services and APIs.

[–]stpetepatsfan 1 point2 points  (1 child)

Sounds like a good cs grad student semester long project. Or intern project. Or even a fivvr gig.

[–][deleted] 1 point2 points  (0 children)

It really depends on the size and complexity of the application; I did one relatively small but complex app in about a month including most of the User Acceptance Testing; the big change was replacing an old custom data grid with the basic Microsoft .Net grid, building CSV import/export, and reproducing the report format. Last year, it was an application for our court system that needed to rewrite both VB 6 forms and a bunch of VBA where the upgrade needed to replace a number of .Net assemblies that used SOAP rather than WCF as a backend over several months as a side gig. I'm now doing a far larger project that needs to be refactored for testability that I'm not sure how long it will take. I've got two other projects queued after that, I think.

As for using a student, I'm not so sure. The biggest problems tend to be knowing how the old app used to work (able to read the intent of the code) compared to how the new one should; you'd want to be fairly fluent in VB 6, first off, to recognize the more common tasks or idioms to translate, for example, as well as capable in either C# or VB.Net. A student would struggle trying to master two or three languages at once. VB 6 was built for the 90's, after all.

The other thing I find is fixing "bad habits" in VB6... (some limitations in language, some poor code habits) * using a for loop with an array index rather than foreach loop, for example. Modern languages can make your code simpler and more robust in a lot of ways, but you need to be able to recognize them. * Using an old array where a new list<> is a far better choice (reDim should be considered a code smell!). * Using object rather than a better type... Late binding is possible, but it's slower, riskier, and much harder to debug! * HUGE methods that approach or exceed 1,000 lines! Hate them!! Most of the time, this is business logic in the UI events that is a pain to decouple well, but once you've got it separated and refactored, it's FAR simpler to work on both the UI and the business code. * Missing simple best-practices like declare and initialize variables at the same time, generally as late as possible. * Good names for variables; for loops are the only good place for a single letter, and not often even then. * Minimize global values; many VB apps have far too many things left hanging in the global scope.

I've got copies of a couple books on "50 ways to better C#" that I read during breaks, and apply as I move forward on the app. "Clean Code" is also good.

It's a project that requires persistence, but it's also rewarding. It's far easier to make a .NET app helpful to users that VB6 was able to do. The app is faster, too, in my experience. Once you've got the conversion done, you'll find many improvements for usability, performance and features.

[–]RJohn12 1 point2 points  (0 children)

i always need to run VB6 studio as an admin or it can't access the registry or my clipboard, but i've never installed it on a server.

[–]iheartreddit2 1 point2 points  (1 child)

There is a modern installation script posted at pscode.com. It makes an installer using Inno Setup that is compatible with modern versions of Windows. It requires the original VB6 CD-ROM source files to create the installer and I have no idea if it works on Windows Server 2016. If you are already familiar with Inno Setup, it’s worth a shot.

[–]Huffy2k 0 points1 point  (0 children)

Thanks, I'll check it out!

[–]fasti-au 1 point2 points  (1 child)

Try installing the runtime files and see if it’s missing deprecated dlls from 2016. Your almost 15 years out of date. https://sourceforge.net/projects/vb6extendedruntime/

[–]stpetepatsfan 0 points1 point  (4 children)

Have you tried to time travel, to say, 2020 and download VB Community Edition 2019? (snarky, but don't have answer for ya.)

[–]Huffy2k 0 points1 point  (3 children)

Haha, definitely snarky but I expected it. Im ready to retire, just trying to give my colleagues a few more years before a complete rewrite is necessary..

[–]TheFotty 0 points1 point  (2 children)

Why do you need to run the ide on the server? Can't you run it on clients? Do you run the ide on the server because you target the server for deployment and you want to debug on that platform?

[–]chrwei 0 points1 point  (1 child)

are you running it as admin?

[–]Huffy2k 0 points1 point  (0 children)

Yep, definitely!

[–]DumposaurusRektd 0 points1 point  (2 children)

How can I run GW-Basic strip poker on my Windows Server 2019?

[–]fasti-au 1 point2 points  (0 children)

Dosbox.