Share via


MarshalEvents Property

The MarshalEvents property gets or sets whether events that are fired on the ISoftUSBEndpointEvents interface should be fired on an arbitrary thread or on the thread that created the SoftUSBEndpoint object.

This property is read/write.

Syntax

HRESULT put_MarshalEvents(
  [in]           VARIANT_BOOL fMarshalEvents
);

HRESULT get_MarshalEvents(
  [out, retval]  VARIANT_BOOL *pfMarshalEvents
);

Property Value

The new state for marshal events.

Error Codes

MarshalEvents returns S_OK if the operation succeeds or E_POINTER if the pfMarshalEvents parameter is not a valid pointer.

Remarks

The following C++ code example shows to set and get the MarshalEvents property.

HRESULT CLoopBackDevice::UpdateMarshalEvents(ISoftUSBEndpoint *piEndpoint)
{
HRESULT hr = S_OK;
VARIANT_BOOL   fMarshalEvents= FALSE;
VARIANT_BOOL   fNewMarshalEvents = TRUE;

 if(NULL == piEndpoint)
{
 hr = E_INVALIDARG;
 goto Exit;
}

// Get the current state of the MarshalEvents property
 hr = piEndpoint->get_MarshalEvents (&fMarshalEventst);
 if(FAILED(hr))
 goto Exit;

// Update the MarshalEvent property if required.
 if (fNewMarshalEvents != fMarshalEvents)
{
 hr = piEndpoint->put_MarshalEvents (fNewMarshalEvents);
 if(FAILED(hr))
 goto Exit;
}
Exit:
 return hr;
}

Requirements

Header

SoftUSBif.h

See Also

ISoftUSBEndpoint

ISoftUSBEndpointEvents

 

 

Send comments about this topic to Microsoft

Build date: 9/21/2010