_IWMEncBasicEditEvents::OnStateChange

Windows Media Encoder SDK banner art

The OnStateChange method indicates whether postprocessing has been started or stopped.

Syntax

HRESULT OnStateChange(
  WMENC_BASICEDIT_STATE  enumState
);

Parameters

enumState

[in]  Specifies a member of the WMENC_BASICEDIT_STATE enumeration type indicating the state of postprocessing.

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_STATECHANGE,
                   OnStateChange )
END_SINK_MAP()

// Implement the event handler for the OnStateChange event.
STDMETHOD( OnStateChange )( WMENC_BASICEDIT_STATE enumState )
{
    // 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
        // OnStateChange event handler.
        case DISPID_BASICEDITEVENT_STATECHANGE:
            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