We need to get web page HTML source document loaded on the PIE web browser in windows mobile. source code that we tried is listed below:
IDispatch* pHtmlDocDispatch;
IOleCommandTarget* pOleCommandTarget;
WEBVIEWLib::IPIEHTMLDocument2* pHTMLDocument2;
WEBVIEWLib::IPIEHTMLWindow2* pHTMLWindow;
IPIEHTMLElementCollection* pHTMLElementCollection;
hr = pWebBrowser->get_Document(&pHtmlDocDispatch);
CHR(hr);
if (pHtmlDocDispatch != NULL)
{
hr = pHtmlDocDispatch->QueryInterface(IID_IPIEHTMLDocument2, (void**)&pHTMLDocument2);
CHR(hr);
hr = pHTMLDocument2->get_parentWindow(&pHTMLWindow);
CHR(hr);
pHTMLDocument2->get_innerHTML() ... oh. bugger.
}
We have found that getting innerHTML() method is missing in Windows Mobile version of web browser control(PIE).
Now how should we obtain a HTML document from the PIE control. Is their an possible solution?
Thanks, Ramanand
Well, I've never developed for PIE, but I know the IE activeX interfaces reasonably well. If you have an IDispatch* pointer for the document element, you should be able to just use the IDispatch interfaces to get the DISPID for "innerHTML" and then call Invoke with DISPATCH_PROPERTYGET to get the value.
Similarly DISPATCH_PROPERTYPUT should be able to set the value, though it bears mentioning that to do a propertyput you may need to also include a named arg with DISPID_PROPERTYPUT in it.