01-18-2008, 07:00 PM
I loaded a Program that I had partially completed in VB 4. It converted the files, only loaded 2 forms 16 & 17 and then declared it could not find sub main. I thought that Form1 was the default loader and my splash screen
was form1. where should I put a sub main and would that force the loading of all 20 other forms?
01-18-2008, 07:04 PM
Most programs don't need a Sub Main(), and when you do have one it needs to be in a standard BAS module.
I'm not sure why a program would start off by loading 20 forms (I'd think most would be loaded upon demand) or what Sub Main() has to do with that. But if the original program was supposed to have one it sounds as if it has gotten lost in conversion.
01-18-2008, 07:41 PM
I still use them on rare occasions. Usually to load a particular form that was last used or to pop up a splash screen wilst doing initialization work in the background.
01-18-2008, 07:50 PM
Well you really need to call InitCommonControls/Ex from a Sub Main() too. Any startup Form event risks being too late.
They also see wide use in ActiveX EXEs and other formless programs.
Clearly they have uses.
01-18-2008, 08:05 PM
Almost all of my programs have a Main()
01-19-2008, 11:40 AM
Set the dropdown menu to "Form1" and not "Sub Main".