🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #13222

Re: BHO question

#13222
From: Martin C
Date: Mon, 20 Oct 2003 17:25
54 lines
3082 bytes
Hi Remy,

I am trying to use the following code in my BHO dll, to retrieve the HTML
content of any visited url, and it works ok on most of the web pages, but I
always retrieve rubbish if any web site contains dhtml, so can you tell me
please what I am doing wrong here...


                case DISPID_DOCUMENTCOMPLETE:
                {
//                        CHAR    str[80];
//                        sprintf(str, "%p %p",
pDispParams->rgvarg[0].pdispVal, pDispParams->rgvarg[1].pdispVal);
//                        MessageBox(NULL, str, NULL, MB_OK);


                        CComQIPtr<IWebBrowser2, &IID_IWebBrowser2>
m_spWebBrowser2Tmp;
                        m_spWebBrowser2Tmp =
pDispParams->rgvarg[1].pdispVal;

                        if( m_spWebBrowser2Tmp )
                        {
                                CComPtr<IDispatch> pIDispatch;
                                HRESULT hr =
m_spWebBrowser2.p->get_Document(&pIDispatch);

                                if ( SUCCEEDED(hr) )
                                {

CComQIPtr<IHTMLDocument2,&IID_IHTMLDocument2> pADocument;

CComQIPtr<IHTMLElementCollection,&IID_IHTMLElementCollection> pHtml;

                                        pADocument = pIDispatch;
                                        pIDispatch.Release();

                                        WCHAR   *szText;
                                        long    k;

                                        pHtml.p->toString(&szText);

                                        MessageBoxW(NULL, szText, NULL,
MB_OK);
                                }

                        }
                        break;
                }


Looking forward for your reply

BR
Technical Details
Message-ID: <3f941a75$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!small1.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <3f84957c@newsgroups.borland.com> <3f84a0b8@newsgroups.borland.com> <3f88b9db@newsgroups.borland.com> <3f88be72$1@newsgroups.borland.com> <3f897b9a@newsgroups.borland.com> <3f89c56f$1@newsgroups.borland.com> <3f8af683@newsgroups.borland.com> <3f8af95a$3@newsgroups.borland.com> <3f8affad@newsgroups.borland.com> <3f8b009f$3@newsgroups.borland.com> <3f8ed9f0$1@newsgroups.borland.com> <3f8edeb3$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,15b7dd6889830f4f
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-10-20 10:33:09 PST
From: "Martin C" <martinc@aol.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <3f84957c@newsgroups.borland.com> <3f84a0b8@newsgroups.borland.com> <3f88b9db@newsgroups.borland.com> <3f88be72$1@newsgroups.borland.com> <3f897b9a@newsgroups.borland.com> <3f89c56f$1@newsgroups.borland.com> <3f8af683@newsgroups.borland.com> <3f8af95a$3@newsgroups.borland.com> <3f8affad@newsgroups.borland.com> <3f8b009f$3@newsgroups.borland.com> <3f8ed9f0$1@newsgroups.borland.com> <3f8edeb3$1@newsgroups.borland.com>
Subject: Re: BHO question
Date: Mon, 20 Oct 2003 09:25:03 -0800
Lines: 56
Organization: V Safe
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: 62.135.27.5
Message-ID: <3f941a75$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1066670709 62.135.27.5 (20 Oct 2003 10:25:09 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!small1.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail