Share via


Device.Device(Guid) Constructor (Microsoft.DirectX.DirectSound)

Initializes a new instance of the Device class.

Definition

Visual Basic Public Sub New( _
    ByVal guidDev As GuidLeave Site _
)
C# public Device(
    GuidLeave Site guidDev
);
C++ public:
 Device(
    GuidLeave Site guidDev
);
JScript public function Device(
    guidDev : GuidLeave Site
);

Parameters

guidDev System.Guid
The GuidLeave Site of the device to create an instanse of. See Remarks.

Remarks

To create an instance a particular Device object using its GuidLeave Site, first retrieve an available device's DeviceInformation from the DevicesCollection object, then get the GuidLeave Site from the DeviceInformation.DriverGuid property.

The application must call the SetCooperativeLevel method immediately after creating a Device object.

Exceptions

AllocatedException The request failed because resources, such as a priority level, were already in use by another caller.
ArgumentExceptionLeave Site An invalid parameter was passed to the called method.
NoAggregationException The object does not support aggregation.
NoDriverException No sound driver is available for use, or the given globally unique identifier (GUID) is not a valid Microsoft DirectSound device identifier (ID).
OutOfMemoryExceptionLeave Site DirectSound could not allocate sufficient memory to complete the call.