Sys(2334)

SYS(2334) reports the Automation server's invocation mode. This function tells you how any method of your Automation server was invoked.

Usage

cStartedAs = SYS( 2334 )

Parameter

Value

Meaning

cStartedAs

Empty string or 0

Unknown. The method might be running as part of the initialization of the object (called from Init) or as a standalone EXE.

1

This method was called as part of an application server supporting VTable binding.

2

This method was called as part of an application server not supporting VTable binding, via the older IDispatch interface.


It might be important to your COM server's behavior to determine how it was invoked, although we haven't thought up a case for this yet. We're more likely to use StartMode to determine the environment in which the code is running, but if you need to distinguish between VTable and IDispatch invocations, here's the way to do it.It's not documented, but SYS(2334) returns an empty string if you call it at times when none of the values are appropriate—for example, from the command line or within a routine that's not running as part of an OLEPUBLIC method. It returns 0 when operating as an Automation server in those methods that don't use either interface—for example, Init, Error or Destroy.

Example

IF SYS(2334) = "2"  && IDispatch call

See Also

StartMode, Sys(2333)


Back to Table of Contents

Copyright © 2002-2018 by Tamar E. Granor, Ted Roche, Doug Hennig, and Della Martin. Click for license .