Progress
Language Reference


COM Object References

Because a chain of COM object property and method references ultimately resolve to a single property or method reference, the syntax diagrams that describe COM object references begin with the three basic types of statements that reference properties and methods:

Property Write

SYNTAX
Com-Handle-Var :COMProperty [ AS Datatype ] = expression
  [ NO-ERROR ]  

Property Read

SYNTAX
[ { field | COMProperty } = ]
  Com-Handle-Var :COMProperty [ NO-ERROR ] 

Method Call

SYNTAX
[ { field | COMProperty } = | NO-RETURN-VALUE ]
  Com-Handle-Var :COMMethod [ NO-ERROR ] 

Com-Handle-Var is any COM-HANDLE variable set to the handle of an instantiated COM object; field is any Progress variable, database field, or widget attribute reference of a compatible data type; expression is any combination of 4GL elements that results in a single value.

NOTE: You can invoke both a property read and a method call as part of an expression in another statement (such as in a DISPLAY statement). You can also directly invoke both property reads and method calls as statements in themselves. However, direct invocation is meaningful only for method calls.

The following syntax boxes describe the remaining components of these basic statements:

COMProperty

SYNTAX
[ { COMProperty | COMMethod } : ] ...
  Property-Name [ ( index [ , index ] ... ) ] 

Property-Name is the name of the referenced property. The optional multi-level index is an integer expression as required by the property. You must not follow the colon separator by a space.

COMMethod

SYNTAX
[ { COMProperty | COMMethod } : ] ...
  Method-Name ( [ COMparm [ , COMparm ] ... ] ) 

Method-Name is the effective name of the referenced method. COMparm is a parameter as required by the method. You must not follow the colon separator by a space.

COMParm

SYNTAX
{ [ OUTPUT | INPUT-OUTPUT ] expression [ AS Datatype ]
    [ BY-POINTER | BY-VARIANT-POINTER ]
  | null-parm
} 

A null-parm is any amount of white space.

NOTE: There is currently no support for named parameters, for example:
Method-Name(Color="GREEN", Shape="SQUARE")Datatype

Datatype

SYNTAX
SHORT | FLOAT | CURRENCY | UNSIGNED-BYTE | ERROR-CODE
  | IUNKNOWN 

The requirements for using the OUTPUT, INPUT-OUTPUT, BY-VARIANT-POINTER, BY-POINTER, and AS Datatype options depend on the COM object method or property, the implementation of the COM object, and how you plan to use the parameter or property in your application. In many cases, expression is all that you require for a property write or method parameter. For more information and examples of COM object references, see the chapter on ActiveX Automation and the chapter on control container support in the Progress External Program Interfaces manual.


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095