How to Determine If VB 4.0 App Was Launched as OLE ServerLast reviewed: October 30, 1995Article ID: Q129739 |
The information in this article applies to:
SUMMARYThis article describes how to use the StartMode Property of the Visual Basic App object to determine whether an application started as a stand-alone project or as an OLE Automation object application.
MORE INFORMATIONIf the StartMode property has a value of vbSModeStandalone (or 0), it means that the application started as a stand-alone project. That is, the user started the .EXE from File Manager or by double-clicking the icon from Program Manager. If the StartMode property has a value of vbSModeAutomation (or 1), it means that the application started as an OLE Automation object application. That is, the .EXE started because an OLE Automation client called CreateObject. These constants are listed in the Visual Basic object library in the Object Browser. At design time, you can debug an application as if it were started as an OLE Automation object application by setting StartMode in the Project Options dialog box to 1 (vbSModeAutomation) by selecting the OLEServer option button. But a project's actual StartMode setting is determined by how that application is started at run time, not by its nominal setting in the Project Options dialog box when you create an executable (.EXE) file. When StartMode is set to 1 and there are no public classes in the project, you must use the End statement or choose End from the Run menu or toolbar to end the application. If you choose Close from the Control menu, the form closes but the project is still running.
Step-by-Step Example
|
Additional reference words: 4.00 vb4win vb4all
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |