5 #ifndef _INC_cOleWebHelper_H
6 #define _INC_cOleWebHelper_H
12 #if defined(_WIN32) && defined(_MSC_VER)
14 #include "../WinAPI/cComConnectionPoint.h"
25 class GRAYLIB_LINK cOleWebHelper :
public cComConnectionPoint,
public DWebBrowserEvents2
31 typedef cComConnectionPoint SUPER_t;
34 cTimeSys m_tProgressChange;
35 cOleWebBase* m_pOleControlParent;
41 HRESULT SendWebEvent(IOleWebListener::WEBEVENT_TYPE eEvent, BSTR theParam,
int x = 0,
int y = 0);
43 virtual HRESULT STDMETHODCALLTYPE Invoke(DISPID dispIdMember, REFIID riid, LCID lcid,
44 WORD wFlags, ::DISPPARAMS __RPC_FAR *pDispParams, VARIANT __RPC_FAR *pVarResult,
45 ::EXCEPINFO __RPC_FAR *pExcepInfo, UINT __RPC_FAR *puArgErr);
48 cOleWebHelper(cOleWebBase* pAtlControlParent)
49 : cComConnectionPoint(static_cast<DWebBrowserEvents2*>(this), LIBID_SHDocVw, __uuidof(DWebBrowserEvents2))
50 , m_pOleControlParent(pAtlControlParent)
52 ASSERT(m_pOleControlParent !=
nullptr);
53 ASSERT(m_pOleControlParent->m_pWebBrowser !=
nullptr);
57 virtual ~cOleWebHelper()
62 IDISPATCH_DISAMBIG_R(cComDispatch);
64 virtual bool isDisposed()
const
66 return m_pOleControlParent ==
nullptr;
70 m_pOleControlParent =
nullptr;
71 HRESULT hRes = SUPER_t::DisposeThis();
75 STDMETHOD(QueryInterface)(REFIID riid, LPVOID* ppv)
77 if (riid == __uuidof(DWebBrowserEvents2))
79 *ppv =
static_cast<DWebBrowserEvents2*
>(
this);
83 return SUPER_t::QueryInterface(riid, ppv);
#define GRAYLIB_LINK
Definition: GrayLibBase.h:35
#define IUNKNOWN_DISAMBIG_R(TYPE)
Definition: IUnknown.h:85
INT32 HRESULT
_WIN32 style error codes. INT32
Definition: SysTypes.h:465
#define ASSERT(exp)
Definition: cDebugAssert.h:87
cStringT< char > cStringA
Definition: cString.h:635