/*****************************************************************************
* viewobject.cpp: ActiveX control for VLC
*****************************************************************************
- * Copyright (C) 2005 VideoLAN
+ * Copyright (C) 2005 the VideoLAN team
*
* Authors: Damien Fouilleul <Damien.Fouilleul@laposte.net>
*
{
if( dwAspect & DVASPECT_CONTENT )
{
- if( _p_instance->getVisible() )
- {
- RECT bounds;
- bounds.left = lprcBounds->left;
- bounds.top = lprcBounds->top;
- bounds.right = lprcBounds->right;
- bounds.bottom = lprcBounds->bottom;
- _p_instance->onPaint(hdcDraw, bounds, bounds);
- }
+ RECT bounds;
+ bounds.left = lprcBounds->left;
+ bounds.top = lprcBounds->top;
+ bounds.right = lprcBounds->right;
+ bounds.bottom = lprcBounds->bottom;
+ _p_instance->onPaint(hdcDraw, bounds, bounds);
return S_OK;
}
return E_NOTIMPL;
LPADVISESINK *ppAdviseSink)
{
if( NULL != pdwAspect )
- *pdwAspect = 0;
+ *pdwAspect = _dwAspect;
if( NULL != padvf )
- *padvf = 0;
+ *padvf = _advf;
if( NULL != ppAdviseSink )
- *ppAdviseSink = NULL;
+ {
+ *ppAdviseSink = _pAdvSink;
+ if( NULL != _pAdvSink )
+ _pAdvSink->AddRef();
+ }
return S_OK;
};
STDMETHODIMP VLCViewObject::SetAdvise(DWORD dwAspect, DWORD advf,
LPADVISESINK pAdvSink)
{
- return OLE_E_ADVISENOTSUPPORTED;
+
+ if( NULL != pAdvSink )
+ pAdvSink->AddRef();
+
+ if( NULL != _pAdvSink )
+ _pAdvSink->Release();
+
+ _dwAspect = dwAspect;
+ _advf = advf;
+ _pAdvSink = pAdvSink;
+
+ if( (dwAspect & DVASPECT_CONTENT) && (advf & ADVF_PRIMEFIRST) && (NULL != _pAdvSink) )
+ {
+ _pAdvSink->OnViewChange(DVASPECT_CONTENT, -1);
+ }
+
+ return S_OK;
};
STDMETHODIMP VLCViewObject::Unfreeze(DWORD dwFreeze)