Hi guys,

I got as far as getting a web page into an IHTMLDocument2 but I don't know what to do from there, all the examples I found are C# or .NET or something else I don't understand.

Will someone please give me a simple example in C++ of getting all the links from an IHTMLDocument2 ?

I was able to do this:

Code:
IHTMLElementCollection* collection;
hResult=document->get_links(&collection);
long nLinks;
collection->get_length(&nLinks); // returns correct number
collection->Release();
How do I loop through the collection and extract the actual links ? Also, if they come out as BSTR do I simple treat them as WCHAR* ? If I can do that I can figure out the rest myself.

Thanks a lot.