Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ Plant SCADA

_ObjectCallMethod

  • Last UpdatedFeb 28, 2024
  • 1 minute read

Calls a specific method for an ActiveX object. (See the documentation for your ActiveX object for details on methods and properties.)

Note: The parameter list passed to the control can only have Cicode variables or variable tags; it cannot use values returned directly from a function because an ActiveX control may modify parameters passed to it.

For example:

//Calculate a value and pass to ActiveX control

_ObjectCallMethod(hControl, "DoSomething", CalcValue());

This is not allowed because the return value of a function cannot be modified. The following should be used instead:

INT nMyValue;

//Calculate Value

nMyValue = CalcValue();

//Pass Value to ActiveX control

_ObjectCallMethod(hControl, "DoSomething", nMyValue);

Syntax

VARIANT _ObjectCallMethod(hObject, sMethod, vParameters)

hObject:

The handle for the object (as returned by the ObjectByName function).

sMethod:

The name of the method.

vParameters:

A variable length parameter list of method arguments. The variables will be passed however you enter them, and will then be coerced into appropriate automation types. Likewise, any values modified by the automation call will be written back - with appropriate coercion - into the passed Cicode variable.

Return Value

The return value from the method - if successful, otherwise an error code is returned.

ObjectByName, DspAnCreateControlObject, CreateObject, CreateControlObject

Example

See CreateControlObject.

See Also

ActiveX Functions

In This Topic
Related Links
TitleResults for “How to create a CRG?”Also Available in