2015-01-17 11:23:05|?次阅读|上传:wustguangh【已有?条评论】发表评论
CAxWindow的成员函数QeueryControl用来查询指定类型的接口,该函数的相关说明如下:
CAxWindow::QueryControl Retrieves the specified interface of the hosted control. HRESULT QueryControl( REFIID iid, void** ppUnk ); template <class Q> HRESULT QueryControl( Q** ppUnk ); Parameters iid [in] Specifies the IID of the control's interface. ppUnk [out] A pointer to the interface of the control. In the template version of this method, there is no need for a reference ID as long as a typed interface with an associated UUID is passed. Q [in] The interface that is being queried for. Return Value A standard HRESULT value. Requirements Header: atlwin.h |
这样,你就可以使用IWebBrowser2接口来操作Web Browser控件了,该例子实现的效果如下所示: