You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Provides COM support in any version of OpenInsight.

Syntax

Result = SRP_Com(Object, Service, Name, Param1, ..., Param16)

Returns

The meaning of the return value depends on the service.

Parameters

ParameterDescription
ObjectThe target COM object. Required.
ServiceThe action to take against the COM object. Required.
NameIdentifies the service's target, such as a property name. Optional. Some services require this parameter, others do not. See service topics for details.
Param1 - Param16Optional parameters for COM methods and properties.

Remarks

The SRP_Com method was developed to meet a need for accessing COM components from within versions of OI that do not yet have that functionality built in.

Object

Typical usage of COM requires objects to be instantiated, with a handle to the object returned into an OI variable. This parameter requires a handle to an object in order call methods and properties. Note that some methods and properties return new object handles, and those handles can be used to "dig deeper" into the COM object hierarchy.

Service

Much like the Utility function in OpenInsight, the SRP_Com function provides multiple services which are identified in the Service parameter. The services are:

ServiceDescription
CREATEInstantiates a COM object.
RELEASEReleases a previously instantiated COM object from memory.
GETGets a COM object's property value.
SETSets a COM object's property value.
CALLExecutes a COM object's method.
ERRORReturns the latest COM error.

Click on the service names above to read more details. Continue below for an explanation of the other parameters.

Name

The Name parameter is used by the CREATE, GET, SET, and CALL services. For other services, it should be blank. For the CREATE service, Name is the ProgId identifying the COM object to instantiate. For the GET and SET services, Name identifies a property. For the CALL service, Name identifies a method.

Param1 - Param16

COM properties and method often require additional parameters. SRP_Com supports up to 16 parameters to be passed. If you encounter a need for more, contact SRP Computer Solutions, Inc. and we will be happy to accommodate you.

  • No labels