|
Posted by Steve Block on November 7, 2007, 3:01 pm
Please log in for more thread options
Hi,
I'm trying to get the IWebBrowser2 interface for the instance of IE
hosting an ActiveX object on Windows Mobile 5 Pocket PC.
My object inherits from IObjectWithSiteImpl. The code I'm using is
below, and is called from my implementation of
IObjectWithSite::SetSite(IUnknown *site).
CComQIPtr<IServiceProvider> service_provider;
CComQIPtr<IWebBrowser2> browser;
HRESULT hr1 = site->QueryInterface(IID_IServiceProvider, (void **)
(&service_provider));
HRESULT hr2 = service_provider->QueryService(IID_IWebBrowserApp,
IID_IWebBrowser2, reinterpret_cast<void**>(&browser));
The call to QueryInterface works fine, but the call to QueryService
fails with E_NO_INTERFACE. I've tried creating the object using both
<object> and ActiveXObject() in the HTML but neither work.
The code works fine on desktop IE, and also works on Pocket PC when I
create the object as a browser helper object, but not when the object
is an ActiveX object.
Any suggestions? My overall intent is to get the URL of the page on
which the ActiveX object was created, so please let me know if there's
an alternative method of doing this.
Thanks, Steve
|