Need Startup or Sub Main

BOBH
BOBH used Ask the Experts™
on
Can someone outline the proper proper proceedure for transferring VB files from a 98 machine to an XP machine without being told that you must have a startup or sub main? I' am copying the VBP and FRM files to disc and then accessing the disc from the second machine. The above message is persistant.
                              BobH
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Open the VBP file with notepad.  Look for the Startup= entry.  Chances are you didn't include the form/module that contains that information when you copied.  Keep in mind that VB allows you to put form/bas/class, etc files in totally separate directories from where the VBP is stored.

Start up object or sub main is the first piece of code which gets executed when you run your vb appliccation
it could be
1) any form
2) a sub procedure defined in a bas module.

In second case you can also trap the command line arguments.

An example of start up frmSplash and you will code the further execution of your application in form load of frmSplash.

Another example could be sub main as below defined in any bas module

sub main()
MDIForm1.show
End Sub
This msg you might be getting because of
1) the start up object a) The form b) the bas module is missing and because of the its giving you this error
2) vbp file corrupted, you need to set the startup object as in the above comment.
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Its quite easy to save progra, components in the wrong place.  Before moving the files, on the old machine, open the project and click on eash form, module and class, etc. and use the "Save as" option to confirm where each item has been saved.
You can see the location of where each file is saved by looking at the VBP in notepad as well.

Author

Commented:
That is a lot of good information folks, now if only I understood it all. I'll print it out and be back. I haven't tried the notepad thing yet, but I did have both the VBP and and the form file copied over.  Information that I have recieved in the past indicated that those were the only two that were necessary.  Others were system specific.
                                    LATER     BOBH

Commented:
Following through on twalgrave's advice:

In the .vbp in Notepad, you'll see entries like:
Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#..\..\..\windows\SYSTEM\StdOle2.Tlb#OLE Automation

I leave those alone.

All others, I just get rid of the path, as follows:

Object={831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0; MSCOMCTL.OCX
Form=frmAbout.frm
Module=modMain; modMain.bas
Class=MyClass; MyClass.cls
UserControl=MyControl.ctl

VB then assumes the files are in the current path.

Commented:
If you have any .??x files (.frx, .ctx), those should ALWAYS be copied along with the associated .frm or .ctl files.  You will also need .bas and .cls files, if any exist.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in Community Support that this question is:
- assign points to twalgrave
Please leave any comments here within the
next seven days.
Force accepted

** Mindphaser - Community Support Moderator **

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial