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 built to these attributes.
boWantAnswer Specifies whether the callback function is executed already when the dpConnect is called or first when a value is changed.

Description

Builds 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, dpConnectCB() is triggered when a value is changed. In addition to a value also ident is passed to dpConnectCB().

It is possible to have several references to the ComManager in an application but it is always exactly one object. The object cannot differentiate which reference was used to call dpConnect. Thus, all references are informed via the dpConnectCB() when a value changes. Therefore the client has to decide (on the basis of 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