#pragma once
#include "oaidl.h"
#include "mshtml.h"
class CIECtrl;

class CMyEventSink : public IDispatch
{
	public:
		CIECtrl* mWebCtrl;
		
	public:
		CMyEventSink(void);
		~CMyEventSink(void);


		// IUnknown methods
		STDMETHOD(QueryInterface)(REFIID riid, LPVOID* ppv);
		STDMETHOD_(ULONG, AddRef)();
		STDMETHOD_(ULONG, Release)(); 


	// IDispatch method
	STDMETHOD(GetTypeInfoCount)(UINT* pctinfo)
			{  return E_NOTIMPL; }

	STDMETHOD(GetTypeInfo)(UINT iTInfo,
            LCID lcid,
            ITypeInfo** ppTInfo)
			{ return E_NOTIMPL; }

	STDMETHOD(GetIDsOfNames)(REFIID riid,
            LPOLESTR* rgszNames,
            UINT cNames,
            LCID lcid,
            DISPID* rgDispId)
			{ return E_NOTIMPL; }
        



	STDMETHOD(Invoke)(DISPID dispIdMember,
            REFIID riid,
            LCID lcid,
            WORD wFlags,
            DISPPARAMS __RPC_FAR *pDispParams,
            VARIANT __RPC_FAR *pVarResult,
            EXCEPINFO __RPC_FAR *pExcepInfo,
            UINT __RPC_FAR *puArgErr);


	protected:
		IHTMLWindow2* m_pWin;
		DWORD m_dwRef;

		LPCONNECTIONPOINT m_pCP;
		HRESULT m_hrConnected;
		DWORD m_dwCookie;

};
