Re: HTML DOM



Hi,

I am also facing some similar problem with using PIE. Have your
resolved your issue?

Thanks & Regards,
Paresh

Ed Harstronder wrote:
> Hello,
>
> This is all under Windows Mobile 2003 4.21
>
> My question is in regards of HTML DOM access. From the IPIEHTMLDocument
> interface, I am able to get, for example, a list of links in the HTML page.
> The code looks like this:
>
> if ( iBrowser3->get_document ( (IDispatch **)&pDocument ) == S_OK ) {
> IPIEHTMLDocument *pHTMLDocument = NULL;
> if ( pDocument->QueryInterface ( __uuidof(IPIEHTMLDocument), (void
> **)&pHTMLDocument ) == S_OK ) {
> IPIEHTMLElementCollection *pElementCollection = NULL;
> if ( pHTMLDocument->get_links ( &pElementCollection ) == S_OK )
> {
> pElementCollection->get_length ( (long *)&items );
> for ( int i = 0; i < items; i++ )
> {
> VARIANT vtIndex;
> vtIndex.vt = VT_UINT;
> vtIndex.lVal = i;
> VARIANT var2;
> VariantInit( &var2 );
>
> IDispatch* pItem = NULL;
> if( pElementCollection->item( vtIndex, var2,
> (IDispatch**)&pItem ) == S_OK ) {
> IPIEHTMLAnchorElement* pAnchor = NULL;
> if( pItem->QueryInterface(
> __uuidof(IPIEHTMLAnchorElement), (void **)&pAnchor ) == S_OK ) {
> BSTR bstrName;
>
> if( pAnchor->get_href( &bstrName ) == S_OK ) {
> LOG( L"(((((( href --> %s", bstrName );
> SysFreeString( bstrName );
> }
>
> pAnchor->Release();
> }
> ...
>
> This works just fine and I am able to retrieve the href of every link.
> However, what we want to do is to get the inner HTML code from every link
> (so that we can extract other useful information about the anchor element.
> The only interface that we see can do this is IPIEHTMLElement, but we unable
> to get the interface from the link, so this will fail:
>
> IPIEHTMLElement* pElem = NULL;
> if( pItem->QueryInterface( __uuidof(IPIEHTMLElement), (void**)&pElem ) ==
> S_OK ) {
> LOG(L"ELEMENT CREATED");
> } else LOG(L"FAILED!");
>
> I have tried replacing pItem by pAnchor, but doesn't work in either case.
>
> Also, I would like to ask another question related to this: how can we get
> the text from an HTML page? Say a page displays some text plus 2 links. We
> know how to get the links (using the get_links of the IPIEHTMLDocument
> interface) but how can we access other elements? IPIEHTMLDocument only
> provides ways to get forms, frames, links, etc. But it is not clear to us
> how to retrieve the HTML page text. We guess they are enclosed into other
> elements, but we can't see how.
>
> Also, the messages DTM_DOCUMENTDISPATCH and DTM_BROWSERDISPATCH don't seem
> to return valid interfaces... is there any workaround to this?
>
> Any help in this matter will be greatly appreciated.
>
> Best wishes,
>
> Ed

.



Relevant Pages

  • HTML DOM
    ... My question is in regards of HTML DOM access. ... From the IPIEHTMLDocument ... The only interface that we see can do this is IPIEHTMLElement, ...
    (microsoft.public.windowsce.app.development)
  • HTML DOM
    ... My question is in regards of HTML DOM access. ... From the IPIEHTMLDocument ... The only interface that we see can do this is IPIEHTMLElement, ...
    (microsoft.public.windowsce.embedded)
  • Re: WebBrowser Control Printing
    ... this interface to control WebBrowser control's operation. ... I've decided to take advantage of the layout characteristics of HTML ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Upgrading an OLD (Fortran Powerstation 4.0) compiler
    ... One idea that I had was to use HTML forms to ... provide the interface, text-based Fortran or C/C++ for the calculation ... > nice user interface and it seems NO ONE uses a dos/text interface anymore. ...
    (comp.lang.fortran)
  • Re: Automating dialog with web server from VB.NET
    ... > windows in an HTML page inside the control by using the IOleContainer ... We need to declare some interface. ... We use the WebBrowser control to load the html file we get from the ... > Private Sub AxWebBrowser1_DownloadComplete(ByVal sender As Object, ...
    (microsoft.public.dotnet.languages.vb)

Quantcast