Share via


IDSF::Devices Property

The Devices property returns the root collection of simulated devices.

This property is read-only.

Syntax

HRESULT get_Devices(
  [out, retval]  DSFDevices **ppDSFDevices
);

Property Value

A pointer to caller-allocated space to hold the pointer to the collection of DSFdevice objects that Devices returns. The caller must release the returned interface.

Error Codes

Devices returns S_OK if the device collection is returned correctly or E_POINTER if the ppDSFDevices parameter is not a valid pointer.

Examples

The following VBScript code example shows you how to enumerate IDSF::Devices for a device that matches certain criteria.

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
                Exit For
            End If
        End If
    Next

    Set EnumSimulatedDevices = DevSought

End Function

Requirements

Header

DSFif.h

See Also

IDSF

 

 

Send comments about this topic to Microsoft

Build date: 9/21/2010