IDSFDevice::Enabled Property

The Enabled property describes whether a device is enabled in the way that its hardware interface defines.

This property is read/write.

Syntax

HRESULT put_Enabled(
  [in]           VARIANT_BOOL fvarEnabled
);

HRESULT get_Enabled(
  [out, retval]  VARIANT_BOOL *pfvarEnabled
);

Property Value

A Boolean value that specifies the new enable state.

Error Codes

Enabled returns one of the following values:

Name Meaning
S_OK

The operation succeeded.

E_POINTER

The pfvarEnabled parameter was not a valid pointer.

E_INVALIDARG

The fvarEnabled parameter was not a valid VARIANT_BOOL value.

Examples

The following VBScript code example shows to how set and get the Enabled property.

` Create a USB device
Dim USBDevice : Set USBDevice = CreateObject("SOFTUSB.SoftUSBDevice")

` Get the DSFDevice object from the USB device
Dim DSFDevice : Set DSFDevice = USBDevice.DSFDevice

` Get the Enabled property
Dim DeviceEnabled
DeviceEnabled = DSFDevice.DeviceEnabled

` If the device is not enabled, enable it
If DeviceEnabled <> TRUE Then
 DSFDevice.DeviceEnabled = TRUE;
End If

See Also

IDSFDevice

 

 

Send comments about this topic to Microsoft

Build date: 9/21/2010