IDSFDevice::SetStateBit Method

The SetStateBit method requests that a device perform the requested operation on the specified bit in the DSFDevice::State bitfield.

Syntax

HRESULT SetStateBit(
  [in]  long Bit,
  [in]  DSFBitOp BitOp
);

Parameters

  • Bit [in]
    A long value with the target bit set.

  • BitOp [in]
    The bit operation to perform.

Return Value

SetStateBit returns S_OK if the operation succeeds or E_INVALIDARG if the BitOp parameter contains an unknown value.

Remarks

The SetStateBit method is reserved for future use and is included for completeness.

Examples

The following C++ code example shows how to set the twelfth bit in the StateBit property.

HRESULT CMyDevice::SetStatus()
{
  HRESULT hr = S_OK;
  Long          bit = 0x800; // The bit to be set
 DSFBitOp bitOperation = DSFBitOn; // The bit operation
 DSFDevice *piDSFDevice = NULL;

 hr = get_DSFDevice(reinterpret_cast<DSFDevice*>(piDSFDevice));
 if(!FAILED(hr))
  {
 hr = piDSFDevice->SetStateBit(bit, bitOperation);
  }

  // Release the DSFDevice interface
if (NULL != piDSFDevice)
  {
 piDSFDevice->Release();
 piDSFDevice = NULL;
  }

 return hr;
}

See Also

IDSFDevice

IDSFDevice::State

 

 

Send comments about this topic to Microsoft

Build date: 9/21/2010