Export (0) Print
Expand All

IImageDecodeFilter::Initialize Method

Called when the filter is activated by Windows Internet Explorer.

Syntax


HRESULT Initialize(
    IImageDecodeEventSink *pEventSink
);

Parameters

pEventSink
Pointer to a variable of type IImageDecodeEventSink.

Return Value

Returns S_OK if successful, or an error value otherwise.

Remarks

The IImageDecodeEventSink interfaces provides information about the drawing surface (canvas). As this instance pointer will be used in other methods, you should save it in a member variable.

Example

The following example demonstrates the basic implementation of the IImageDecodeFilter::Initialize method. (Note that it is not necessary to call AddRef on the IImageDecodeEventSink pointer.)


STDMETHODIMP
CImageDecodeFilter::Initialize(IImageDecodeEventSink* pEventSink)
{
    HRESULT hr;

    if (pEventSink == NULL)
        return E_INVALIDARG;

    m_pEventSink = pEventSink;

    hr = pEventSink->OnBeginDecode(&m_dwEvents, &m_nFormats, &m_pFormats);

    return hr;
}

See Also

IImageDecodeEventSink::OnBeginDecode

Community Additions

ADD
Show:
© 2014 Microsoft