无语,查了半天,没有太多资料。
Call this member function to determine whether the WebBrowser object is registered as a top-level browser for target name resolution.
BOOL GetRegisterAsBrowser( ) const;
CWebBrowser2是插入的控件啊,直接在窗体上。我直接继承IDispatch接口,然后在IDocHostUIHandler接口类中添加WBEventDispatch的一个指针,再分配内存,这样可以吗?可以没有执行WBEventDispatch的Invoke。
class WBEventDispatch : public IDispatch
{
public:
long refcount;
WBEventDispatch();
~WBEventDispatch();
// IUnknown
STDMETHODIMP QueryInterface(REFIID iid, void ** ppvObject);
ULONG STDMETHODCALLTYPE AddRef();
ULONG STDMETHODCALLTYPE Release();
// IDispatch
STDMETHODIMP GetTypeInfoCount(unsigned int FAR* pctinfo);
STDMETHODIMP GetTypeInfo(unsigned int iTInfo, LCID lcid,
ITypeInfo FAR* FAR* ppTInfo);
STDMETHODIMP GetIDsOfNames(REFIID riid, OLECHAR FAR* FAR* rgszNames,
unsigned int cNames, LCID lcid, DISPID FAR* rgDispId);
STDMETHODIMP Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags,
DISPPARAMS FAR* pDispParams, VARIANT FAR* parResult,
EXCEPINFO FAR* pExcepInfo, unsigned int FAR* puArgErr);
}; http://www.openeim.com/