InstrSession.AttachObject

Syntax

InstrSession.AttachObject( uniqueId, iPtr, clsid, releaseOnClose)

Purpose

Attaches an object to the session.

Remarks

Instead of attaching an existing object, you can specify that the session creates a particular object when you first call the InstrSession.GetObject method to request the session to return the object. To specify the object to create, pass the NULL pointer, Nothing , as the iPtr parameter and pass the GUID (COM globally unique identifier) of the object as the clsid parameter. Otherwise, pass the object to attach to the session as the iPtr parameter and pass an empty string as the clsid parameter.

Parameters

uniqueId As String

[In] Pass a unique string to use when you retrieve the object. Call the InstrSession.GenerateUniqueID method to obtain a unique string.

iPtr As IUnknown

[In] Pass an ActiveX pointer to the object you attach to the session. You can pass a NULL pointer if you also pass the GUID of the object that you want to create as the clsid parameter.

clsid As String

[In] Pass the GUID of the object to create or pass an empty string to attach an existing object. The format of the clsid string is {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX} .

releaseOnClose As Boolean

[In] Pass True to release the attached object when you explicitly call the InstrSession.Close method on the session. The session always releases the attached object when you release the final reference to the session.

See Also

Attaching Additional Data to a Session

InstrSession.Close

InstrSession.GenerateUniqueID

InstrSession.GetObject