Share via


_IWMEncBasicEditEvents::OnError

Windows Media Encoder SDK banner art

The OnError method receives run-time error events.

Syntax

HRESULT OnError(
  long  hResult
);

Parameters

hResult

[in]  Handle to a result object.

Return Values

If the method succeeds, it returns S_OK. If it fails, it supports the IErrorInfo interface and returns an HRESULT error code.

Example Code

// Define the event sink map which determines the events
// that the application receives.
BEGIN_SINK_MAP(CBasicEditCallBack)
    SINK_ENTRY_EX( EVENT_ID, 
                   DIID__IWMEncBasicEditEvents,
                   DISPID_BASICEDITEVENT_ERROR,
                   OnError )
END_SINK_MAP()

// Implement the event handler for the OnError event.
STDMETHOD( OnError )( long hResult )
{
    // Handle the event.
    return S_OK;
}

// Override the base class virtual function to provide information
// on the implemented event handlers.
HRESULT GetFuncInfoFromId( const IID& iid, DISPID dispidMember,
                           LCID lcid, _ATL_FUNC_INFO& info )
{
    if ( InlineIsEqualGUID( iid, DIID__IWMEncBasicEditEvents ) )
    {
        info.cc = CC_STDCALL;
        info.vtReturn = VT_ERROR;
        switch( dispidMember )
        {
        // Descibe the parameters of the
        // OnError event handler.
        case DISPID_BASICEDITEVENT_ERROR:
            info.nParams = 1;
            info.pVarTypes[0] =  VT_I4;
            return S_OK;
        
        default:
            return E_FAIL;
        }
    }
    return E_FAIL;
}

Requirements

Header: wmencode.h

Library: wmenc.exe

See Also