IDSFDevice::Object Property

The Object property gets or sets an arbitrary object pointer that is associated with a device object and that a GUID identifies.

This property is read/write.


HRESULT put_Object(
  [in]           BSTR GUID,
  [in]           IUnknown *punkObject

HRESULT putref_Object(
  [in]           BSTR GUID,
  [in]           IUnknown *punkObject

HRESULT get_Object(
  [in]           BSTR GUID,
  [out, retval]  IUnknown **ppunkObject

Property Value

The GUID identifier of the GUID-pointer pair.

A pointer to associate with the GUID within the device object.

Error Codes

Object returns S_OK if the operation succeeds or E_POINTER if the ppunkObject parameter is not a valid pointer.

This property can also return other standard COM return values.


The following VBScript code example shows how to get the Object property that is referenced by a known GUID.

Private Function EnumSimulatedDevices(SearchObjectGUID)

    Dim DevSought   : Set DevSought = Nothing
    Dim Dev         : Set Dev = Nothing
    Dim DSF         : Set DSF = CreateObject("DSF.DSF")
    Dim ObjSought   : Set ObjSought = Nothing

    For Each Dev in DSF.Devices
        If Dev.HasObject(SearchObjectGUID) Then
            Set ObjSought = Dev.Object(SearchObjectGUID)
            If Not ObjSought Is Nothing Then
                Set DevSought = Dev
            End If
        End If

    Set EnumSimulatedDevices = DevSought

End Function

See Also




Send comments about this topic to Microsoft

Build date: 9/21/2010