Length Property

The Length property gets or sets the bLength field of the string descriptor, as described in section 9.6.7 of the USB 2.0 specification.

This property is read/write.

Syntax

HRESULT put_Length(
  [in]           BYTE bLength
);

HRESULT get_Length(
  [out, retval]  BYTE *pbLength
);

Property Value

The new value of the bLength field of the string descriptor.

Error Codes

Length returns S_OK if the operation succeeds or E_INVALIDARG if the pbLength parameter is not a valid pointer.

Remarks

The following C++ code example shows how to get the Length property.

HRESULT CLoopBackDevice::GetStringSize(, BYTE *pbSize)
{
HRESULT hr = S_OK;


 if(NULL == pbSize)
{
 hr = E_POINTER;
 goto Exit;
}

// Initialize the return size
*pbSize = 0;


// Get the descriptor length
 hr = piString ->get_Length(pbSize);

Exit:
 return hr;
}

Requirements

Header

SoftUSBif.h

See Also

ISoftUSBString

 

 

Send comments about this topic to Microsoft

Build date: 9/21/2010