![Picotest M3510A Скачать руководство пользователя страница 144](http://html1.mh-extra.com/html/picotest/m3510a/m3510a_user-manual_1555486144.webp)
144
144
144
144
3. Add New Module, and declare a Sub Main().
How to: Change the Startup Object for an Application
The Startup Object property for a project defines the entry point to be
called when the application loads; generally this is set to either the main
form in your application or to the Sub Main procedure that should run
when the application starts. Since Class Libraries do not have an entry
point, their only option for this property is (None).
For Windows Applications projects, only forms or classes with a Public
Sub Main procedure are available as Startup objects unless you check
the Startup with custom Sub Main checkbox; when this option is checked,
you must add code in the Sub Main procedure for the form.
※
Note:
When using a custom Sub Main procedure as the Startup object,
code in the Application events (Startup, Shutdown, Startup
Next
Instance, and Unhandled
Exception) is not executed
.
The Startup Object
property can be set in the Application pane of the Project Designer.
To change the startup object
1. With a project selected in Solution Explorer, on the Project menu
click Properties.
2. Select the Application pane.
3. Select a Startup object from the Startup object drop-down list.
To set the startup object for a Windows Application to Sub Main
1. With a project selected in Solution Explorer, on the Project menu
click Properties.
2. Select the Application pane.
3. Check the Startup with custom Sub Main checkbox.
4. Select Sub Main from the Startup object drop-down list.
LISTING C.1.
MEASure.bas--THE Sub Main FUNCTION IS WHERE YOU
NEED TO ADD INITIALIZATION CODE.
Sub Main()
Dim stat As ViStatus
Dim dfltRM As ViSession