i have some fine code to save the html-code from TcppWebBrowser. This code works on all Win95/98/ME Systems and on my Notebook with XP Pro SP1. Some customers told me, that the software get a access violation. At a time, i could find the same result on a desktop-PC with XP Pro SP 1a. Could this be?
If i look at pMemStream->Memory, i get always NULL.
I have found the reason. I have loaded the newest updates from borland's homepage. Some changes are not made in both directories c:\windows\system32 and borland\bin. There are difference files. So the bpl-file in setup are not right.
But i have not found the reason, why the software works on some pc's ???
The 'new' operator throws an exception if it fails. You don't need to check for a NULL pointer being returned because one won't be returned in the first place.
You should be testing the ReadyState property instead. The Document property can contain a non-NULL value before the document is actually ready to be used.
if(SUCCEEDED(pCppWebBrowser->Document->QueryInterface(IID_IHTMLDocument2,(L P VOID*)&htm))
> && (bool(htm))){
Why are you converting the interface pointer to a bool? You should not be doing that.
Many thanks for your request. This sample is usefull like others in the past. My older version had worked like the new one.
There are a few of pages, which could not be loaded about a stream. If i go directly to the url, all works right, but if i go with a link in TCppWebBrowser to this page it don't work. There is always a zero stream. I`m confused. This happens about the last 2 weeks. But this always happens only with ebay article pages. All other pages from ebay and other locations are working. But some PC's have no problems. So i think there is a reason with a newer patch for internet explorer.
There are a lot of scripts on this pages. Every time there is a Skript-Error. I have filtered the pages and remove some skripts. But if i could not load to stream, this couldn't work. So tomorrow i have a look at this.
Where can i get samples about working with Mozilla or Fireball?
So now a few hours later. This function does not work. The code is visible in the TCppWebBrowser, but i get always a NUll Stream. The save-function fails. But if i reload the page, it works. Maybe, there is a new bug. Could this do something with the new secure from MS? But the most pages could save, there are only a few they don't work.
In the first step i wanted to load the page with indy or fastnet, but the page is loaded in more steps.
Michael Krug <michael.krug*nosp...@utanet.at> wrote in message <news:41349ded$1@newsgroups.borland.com>... > So now a few hours later. This function does not work. The code is > visible in the TCppWebBrowser, but i get always a NUll Stream. The > save-function fails. But if i reload the page, it works. Maybe, there is > a new bug. Could this do something with the new secure from MS? But the > most pages could save, there are only a few they don't work.
> In the first step i wanted to load the page with indy or fastnet, but > the page is loaded in more steps.
Michael,
This may not be the cause of your problem, but you might want to check that though : IE (and therfore TCppWebBrowser) only 'processes' the document when a minimum few 256 bytes or so are loaded in the document. If this amount is not reached, the document loads (you can see it) but you won't be able to fetch the source or use DHTML against it.
I also found that when the page is served using certain apache servers with mod_gzip, this same behaviour happens even more. What a bore.
Now I only use MSXML->IXMLHTTPRequest to get web pages sources, as it is much more flexible and accurate.