Skip to content

IsCOMObject

See Also: FlexCOM Helper Functions, IsNullComObject, IsComObjectCreated, pvComObject

Purpose

Returns True if the passed value is a non-Null IDispatch* value. Otherwise, it returns False.

Return Type

Boolean

Syntax

(IsComObject({vComObject}))

Where:

  • vComObject is a value of type variant.

What it Does

This Boolean function returns True if the passed variable or property is of type variant IDispatch* and is not set to NULL. It will return False otherwise.

Use this function instead of attempting to use an IDispatch* variant in a comparative expression like (vComObject = 0). Such an expression would never work and would raise a runtime error.

The following example tests a variant variable using IsComObject to see if it is a non-Null IDispatch*.

Variant vMyVar
// ...
If (IsComObject(vMyVar)) Begin
    // do something
End