MainFile, MainClass, SetMain
These properties and method indicate and control the main file in a project—that is, the one that gets executed first when the project is run. MainFile and MainClass tell you what the main file is, while SetMain lets you set it programmatically. MainFile and MainClass correspond to the bolded entry in the Project Manager; SetMain is the equivalent of the Set Main option on the Project menu.
Usage |
cMainFile = prjProject.MainFile cMainClass = prjProject.MainClass lMainChanged = prjProject.SetMain([ cMainFile [, cMainClass ]]) |
Parameter |
Value |
Meaning |
cMainFile |
Filename including extension |
The starting program or form of a project, or the class library containing the starting ActiveDoc. |
Empty string |
No main file is designated for this project. |
|
cMainClass |
Class name |
The starting Active Document class of a project. |
Omitted |
Either the main file is a program or no main file is designated for this project. |
|
lMainChanged |
.T. |
The main file was changed. |
.F. |
The main file was not changed. |
Example |
* Assume the active project contains an active document * class named 'acdFred' in a classlib called 'MyActiveDocs' Application.ActiveProject.SetMain("MyActiveDocs.VCX","acdFred") * Find out about the main program of a project referenced * by the variable oProj. ?oProj.MainFile, oProj.MainClass |
See Also |