COM - dpConnect()

Builds a hotlink to attributes of data point elements.

Synopsis

HRESULT dpConnect([in] VARIANT vIdent, [in] VARIANT vDpName, [in, defaultvalue(FALSE)] BOOL boWantAnswer);

Parameter

Parameter Description
vIdent Specified ident for the connect
vDpName Data point attributes. The connection is established to these attributes.
boWantAnswer Specifies whether the callback function is executed when dpConnect is called or only when a value is changed.

Description

Establishes a hot link to attributes of data point elements (a single string or an array of strings). Since there is no equivalent for callback functions within the COM object model, the dpConnectCB() is triggered when a value is changed. In addition to a value, ident is also passed to the dpConnectCB().

You can have multiple references to the ComManager in an application, but it is always exactly one object. The object cannot distinguish which reference was used to call dpConnect. Therefore, all references are informed via the dpConnectCB() if a value changes. The client must therefore decide (using vIdent) whether it is interested in the event or not.

Example

(See ComSample.xls, CComSample)

Public Sub dpConnect()
Dim asDp(1) As String
asDp(0) = "ExampleDP_Arg1.:_online.._value"
asDp(1) = "ExampleDP_Arg2.:_online.._value"
moComManager.dpConnect asDp, asDp, True
moComManager.dpConnect"Ergebnis", "ExampleDP_Result.:_online.._value", True
End Sub

Assignment

COM