Events
May 19, 6 PM - May 23, 12 AM
Calling all developers, creators, and AI innovators to join us in Seattle @Microsoft Build May 19-22.
Register todayThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Retrieves the value associated with the event, if any. The value is retrieved as a PROPVARIANT structure. The actual data type and the meaning of the value depend on the event.
HRESULT GetValue(
[out] PROPVARIANT *pvValue
);
[out] pvValue
Pointer to a PROPVARIANT structure. The method fills this structure with the data.
The method returns an HRESULT. Possible values include, but are not limited to, those in the following table.
Return code | Description |
---|---|
|
The method succeeded. |
Before calling this method, call PropVariantInit to initialize the PROPVARIANT structure. After the method returns, call PropVariantClear to free the memory that was allocated for the PROPVARIANT data.
This interface is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:
The following function gets the event value if the value is an IUnknown pointer. If the PROPVARIANT type is not VT_UNKOWN, the function returns MF_E_INVALIDTYPE.
// Gets an IUnknown pointer from an IMFMediaEvent event and queries
// the pointer for a specified interface.
//
// NOTE: Applies only to events that contain IUnknown pointers.
// Otherwise, the function returns MF_E_INVALIDTYPE.
template <class Q>
HRESULT GetEventObject(IMFMediaEvent *pEvent, Q **ppObject)
{
*ppObject = NULL; // zero output
PROPVARIANT var;
HRESULT hr = pEvent->GetValue(&var);
if (SUCCEEDED(hr))
{
if (var.vt == VT_UNKNOWN)
{
hr = var.punkVal->QueryInterface(ppObject);
}
else
{
hr = MF_E_INVALIDTYPE;
}
PropVariantClear(&var);
}
return hr;
}
Requirement | Value |
---|---|
Minimum supported client | Windows Vista [desktop apps | UWP apps] |
Minimum supported server | Windows Server 2008 [desktop apps | UWP apps] |
Target Platform | Windows |
Header | mfobjects.h (include Mfidl.h) |
Library | Mfuuid.lib |
Events
May 19, 6 PM - May 23, 12 AM
Calling all developers, creators, and AI innovators to join us in Seattle @Microsoft Build May 19-22.
Register today