0

A (very) long time ago I wrote a VB5 program that for some reason I still use today. It took me almost 5 years to complete and only recently have I been experiencing problems with it due to its age.

In fact, only one part has been giving me problems and that is the used Webbrowser Control. The webbrowser control loads webpages (obviously) but during the past few years, more and more websites refuse to display because it detects an older version of IE (what the webbrowser control basically is). Instead, these sites display a message along the lines of "You are using an unsupported browser, please update". Now I can probably get around this message simply by presenting a User Agent string of a modern browser but there is of course a valid reason why these sites no longer support IE. Simply because IE really can't render these sites.

Another problem is that the webbrowser control apparently refuses to display secure sites (https). I think because it uses older certificates that are no longer valid.

Long story short, the program in its current form has reached its end of life. Rewriting the entire program is not an option for me because of the time involved to do this (perhaps years because it really is a huge program) and I simply don't have the time to do it. So I'm guessing I'm left with two options: using an alternative control (which I'm guessing does not exist for VB5) or do some automated migration to another language. All VB5 source code is available of course.

My question is, is this at all possible? Is there any way I can get this to work again? Does anyone have any ideas? Or are my only two options to either rewrite the program, or to dump it?

Gusman
  • 14,905
  • 2
  • 34
  • 50
Zippy1970
  • 601
  • 6
  • 20
  • Depends on how much size. Most work will be to translate the old DAO or ADO to ADO.Net – Tarik Jun 27 '20 at 09:50
  • For a quick test try to see if the Winforms Webbrowser control would even work with those sites.. - Then the next question may be how deeply the webbrowser is integrated and if it could be moved to a separate window.. – TaW Jun 27 '20 at 09:56
  • Back then it took you 5 years to write, but I assume you did gain some experience in the meantime. And maybe there are now libraries that do part of what you then had to write by yourself? – Hans Kesting Jun 27 '20 at 09:58
  • I also failed to mention that you will need to replace many controls: datagrids in particular. – Tarik Jun 27 '20 at 10:01
  • It took me 5 years to write not only because it's a huge program, but also because it's a really, really complex program. Also, it's been at least 10 years since I last wrote a Windows program (have been exclusively building websites since then using HTML5/Javascript/Perl/PHP) so there would be a learning curve for me getting familiar with a new programming language. – Zippy1970 Jun 27 '20 at 10:20
  • Also, why did my question receive a vote to close it? – Zippy1970 Jun 27 '20 at 10:21
  • Try migrating to VB6 and then using the VB Upgrade Wizard to migrate to VB.NET. And try an alternative control. – R.J. Dunnill Jun 27 '20 at 16:24
  • @Zippy1970 And these kinds of questions tend to be closed, even though they're very useful to some of us. – R.J. Dunnill Jun 27 '20 at 20:19
  • The specific close reason given was "Seeking recommendations for books, tools, software libraries, and more". – StayOnTarget Jun 29 '20 at 11:23
  • I think you will get better responses if you can narrow and focus the question. For instance, edit it to ask if there are modern web-browser controls that are compatible with VB5. I bet that's possible. – StayOnTarget Jun 29 '20 at 11:24
  • Or you could post a section of code demonstrating the problem so that someone could post an answer. – R.J. Dunnill Jul 05 '20 at 15:11

2 Answers2

0

one comment suggested to migrate first to VB6 ... and use the migration wizard.

But: You may face the problem, that the migration wizard does not the complete job, so you would still have plenty of work to do.

Again, but: Years ago (early 00´s) I faced the problem of migrating a big application. We couldn´t do it. So we created an "hybrid" application (VB6 with parts of .NET). Later, we did the opposite way: Having an .NET app calling old VB6 forms/classes, but that was years later.

So: What about writing a .NET class (let´s say, the complete form you need for your browser part), make this class/form COM visible, and add it to your VB6 solution ...

You would not lose to much if you give it a try.

nabuchodonossor
  • 2,095
  • 20
  • 18
0

I don’t think updating using VB5 is viable, it was only around for a year and a half. VB6 had new data controls and is generally what companies put their effort into for the next several years.

Updating to VB6 and then to VB.Net (may thence to, C# given your Perl and Php background) is certainly possible. How easy it is to do depends upon how your program was written. If it is well separated as to business logic and forms, and type safety it can be fairly trivial. If your display is all mixed up with your logic, and sometimes use a variable as a string and sometime as integer and sometimes as an variant, it can be nearly hopeless without paying for it.

You say your program is large, but you don’t give a class or file count, you’d really need to know those to make as well as how well the program is written to give a rough estimate. If the complexity is in the business logic, that could conceivably come across with basically no change.

A piece of advise, immediately turn on option infer and option strict once you do the conversion. Also, don’t be intimidated by a huge number of errors when you do your conversion. A lot of them can be fixed en masse by creating an equivalent to VB6’s control arrays.

jmoreno
  • 12,752
  • 4
  • 60
  • 91