It appears, that when there is actually no document object to return, (for
example there is no page, or it is not fully loaded)
this method actually returns #S_OK, but leaves the pointer at 0.
This is not common COM behaviour. Its quite weird in fact.
Just check in an extra If that DocumentDispatch is not 0 and it should be fine.
I actually added this check in one place, but forgot it in another.
The file linked in my first post is now updated. sorry about this.
thanks, now it works fine (i added in the If manually coz ive made mods to the code myself), although, if the webgadget isnt opened with the about:blank url, it doesnt open correctly.... (webgadget_open function)
Demonio Ardente
Currently managing Linux & OS X Tailbite
OS X TailBite now up to date with Windows!
I just checked this code with IE7 because I have started a little project which will
benefit from a web-like GUI, and it works, but not if compiled into unicode.
In that case webGadget_open() always returns 0. Hope you can fix it.
I've been trying this with custom HTML code. I load it into the webgadget with SetGadgetItemText, wait until webgadget finishes loading, then set the CatchLinks callback.
It correctly gets the number of hyperlinks (you can see this in the "LinkCount" variable) but then it crashes!
This is not being done in a thread, by the way.
The hyperlinks are nothing special, either. They're just dummy links to obvious stuff like hotmail, yahoo etc.
Is it necessary to use the "Webgadget_Open" function with the CatchLinks function?
My computer is Windows XP-Professional SP2. It is not connected to the internet - could that be the problem?