Object Property

Purpose

Returns an IDispatch reference to a control.

Syntax

object.Object

object:OLE Automation, Ocx

Description

The GFA-BASIC 32 Ocx controls provide the Object property to obtain an IDispatch interface to the control. The GFA-BASIC 32 Ocx controls support dual interfaces for both early and late binding. When a COM object supports late binding it supports a so called IDispatch interface. When a COM object provides an IDispatch interface, the properties and methods can be executed through a standard function called Invoke. Rather than executing a property or method directly, as with early binding, the Invoke function takes numerous parameters describing the property or method to call, the possible parameters converted to Variants, an exception info block for returning error information, and some more. Invoke itself must lookup the name of the property or method in the COM library and then call it by its address. Calling Invoke for a property or method is a time consuming process, therefore.

Example

OpenW 1

Dim oForm As Object

Set oForm = Win_1.Object

Win_1.AutoRedraw = ' Fast

oForm.AutoRedraw = ' Slow

Do

Sleep

Until Me Is Nothing

 

Sub Win_1_OnCtrlHelp(Ctrl As Object, x%, y%)

' IDispatch reference to the control.

Print Ctrl.WhatsThisHelpID // Slow

EndSub

Remarks

The Control data type is an IDispatch interface as well.

Ocx ToolBar tb

Dim ctrl As Control

Set ctrl = tb

See Also

Object, _DispId

{Created by Sjouke Hamstra; Last updated: 20/10/2014 by James Gaite}