Logo

Hacker’s Guide to Visual FoxPro
An irreverent look at how Visual FoxPro really works. Tells you the inside scoop on every command, function, property, event and method of Visual FoxPro.

StartMode

This property of the Application Object lets you determine how the application was started, so you can decide on the right course of action depending on the facilities available.

Usage

nRetVal = Application.StartMode

Parameter

Value

Meaning

nRetVal

0

Normal VFP interactive session.

1

Out-of-process (EXE) OLE Server.

2

Runtime out-of-process OLE Server.

3

Runtime in-process OLE Server.

Use the StartMode property to determine what capabilities are available to you. For example, you don’t want to raise an error on your big, fancy error-handling form if the application is running as an out-of-process server where you don’t have access to the user interface.

Example

? _VFP.StartMode  && 0, from the Command Window
* FoxMind.Remind is a simple test server, created as an EXE
oDear = CreateObject("FoxMind.Remind")
? oDear.Application.StartMode  && returns 2
* Rebuild the server as a DLL
? oDear.Application.StartMode  && returns 3

See Also

Application, _VFP