Thread View: borland.public.cppbuilder.internet.web
4 messages
4 total messages
Started by Adam
Fri, 10 Feb 2006 10:14
CPPWebBrowser
Author: Adam
Date: Fri, 10 Feb 2006 10:14
Date: Fri, 10 Feb 2006 10:14
6 lines
1060 bytes
1060 bytes
I made a web browser with CppWebBrowser, could you tell me how to get hyperlink address? -- Borland�������� http://www.BorlandBBS.cn
Re: CPPWebBrowser
Author: Hans Galema
Date: Mon, 13 Feb 2006 12:59
Date: Mon, 13 Feb 2006 12:59
8 lines
1204 bytes
1204 bytes
Adam wrote: > I made a web browser with CppWebBrowser, could you tell me how to get > hyperlink address? Please be a bit precise. What are the actions the user does ? What do you want exactly ? Hans.
Re: CPPWebBrowser
Author: Adam
Date: Tue, 14 Feb 2006 00:17
Date: Tue, 14 Feb 2006 00:17
15 lines
1444 bytes
1444 bytes
I mean how to get all links within the web pages. Thanks. -- Borland???? http://www.BorlandBBS.cn "Hans Galema" <notused@notused.nl> wrote in message news:43f08297$1@newsgroups.borland.com... > Adam wrote: >> I made a web browser with CppWebBrowser, could you tell me how to get >> hyperlink address? > > Please be a bit precise. What are the actions the user does ? > What do you want exactly ? > > Hans.
Re: CPPWebBrowser
Author: Hans Galema
Date: Tue, 14 Feb 2006 11:07
Date: Tue, 14 Feb 2006 11:07
46 lines
2225 bytes
2225 bytes
Adam wrote:
> I mean how to get all links within the web pages. Thanks.
To get and show the links from the page displayed by TCppWebBrowser:
void __fastcall TForm1::SpeedButton1Click(TObject *Sender)
{
AnsiString AllLinks = "";
IHTMLDocument2 *HTMLDoc = NULL;
if(SUCCEEDED(CppWebBrowser1->Document->QueryInterface(IID_IHTMLDocument2, (LPVOID*)&HTMLDoc)))
{
IHTMLElementCollection *pAll = NULL;
if(SUCCEEDED(HTMLDoc->get_links(&pAll)))
{
long collSize;
pAll->get_length(&collSize);
IDispatch* id;
VARIANT one;
for( int idx = 0; idx < collSize; idx++)
{
one.vt = VT_UINT;
one.lVal = idx;
VARIANT two = {0};
pAll->item(one,two,&id);
IHTMLElement* pElem = NULL;
id->QueryInterface( IID_IHTMLElement, (LPVOID*)&pElem );
BSTR bstr = NULL;
pElem->toString(&bstr);
AllLinks += bstr;
AllLinks += "\n";
}
pAll->Release();
}
HTMLDoc->Release();
}
ShowMessage ( AllLinks );
}
Hans.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads