Click or drag to resize

IMcObjectAttachNotifySink Method

Attaches either a standard (IID_IMcObjStandardNotify) or custom sink notification interface to the object.

Namespace:  MediaCy.IQL.ObjectManager
Assembly:  MediaCy.IQL.ObjectManager (in MediaCy.IQL.ObjectManager.dll) Version: 10.0.6912.0
Syntax
VB
Function AttachNotifySink ( 
	varISinkIID As Object,
	piunkISink As Object
) As IntPtr

Parameters

varISinkIID
Type: SystemObject
The ISink interface IID. This may be a VT_BSTR in which case the it must be the IID string in the form "{12345678-1234-1234-1234-123456789ABC}". If VT_I4 or VT_UI4, then it must be a cookie from a previous call to either AttachNotifySink or McObjects.AttachNotifySinkToCategory. If VT_EMPTY, VT_ERROR, VT_NULL or IID_IMcObjStandardNotify, the notify sink is to be a standard one.
piunkISink
Type: SystemObject
Instance of the sink interface to notify. QueryInterface on this pointer with the value gotten from the first, varISinkIID, argument must succeed.

Return Value

Type: IntPtr
long notify sink "cookie" identifier for this sink interface. This "cookie" value is the same for the same sink piunkISink for all notify attach methods (AttachNotifySink, McObjects.AttachNotifySinkToCategory and McObjects.AttachNotifySinkToType).
Remarks
By default, whenever a notify sink is attached to an McObject instance, Type or Category (by a call to AttachNotifySink, McObjects.AttachNotifySinkToCategory or McObjects.AttachNotifySinkToType) a reference (AddRef) is placed on the piunkISink notify sink interface. This reference is then released (Release) when the last attached notify on the sink interface is detached (either by a call to DetachNotifySink, McObjects.DetachNotifySinkFromCategory, McObjects.DetachNotifySinkFromType or automatically when the the last notifiying McObject is removed from the McObjects collection). This reference may sometimes create a "deadlock" problem, so you may use the McObjects.SetNotifyRules method to prevent the AddRef/Release on the notify sink interface. If you do so, you must establish some other method to keep a reference on the notify sink interface until you have detached all attached notifies. An Alias-type object (see McObjects.Add) maintains its own list of notify sinks, independent of the sinks attached to its shadow. However, notifications fired by any means (FireStandardNotifyToAllSinks, FireCustomNotify or automatic notifications associated with shared property assignments) to either an Alias or its Shadow result in the notification being sent to the sinks associated with the Shadow and all of its Aliases. The only exception to this is for notifications associated with assignments to Alias-maintained properties (such as a Category assignment); in these cases, the notification is sent only to the list of notify sinks attached to the Alias itself.
See Also