🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.internet.web
2 messages
2 total messages Started by Michael Krug Fri, 27 Aug 2004 11:55
Difference XP SP1 SP1a SP2 ??
#1679
Author: Michael Krug
Date: Fri, 27 Aug 2004 11:55
41 lines
2064 bytes
Hello,

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.


    TMemoryStream* pMemStream=new TMemoryStream();
   if(pMemStream && pCppWebBrowser)
   {
     IPersistStreamInit* pPSI;
     IHTMLDocument2 *htm;
     pMemStream->Seek(0, 0);
     if(!pCppWebBrowser->Document)
     {
       while(!pCppWebBrowser->Document)
         Application->ProcessMessages();
     }
     TStreamAdapter* pStreamAdapter = new TStreamAdapter(
       pMemStream, soReference);


 
if(SUCCEEDED(pCppWebBrowser->Document->QueryInterface(IID_IHTMLDocument2,(LPVOID*)&htm)) 
&& (bool(htm))){
         if( 
SUCCEEDED(htm->QueryInterface(IID_IPersistStreamInit,(LPVOID*)&pPSI)) && 
(bool(pPSI)) ){


         pPSI->Save(*pStreamAdapter,false);
         pPSI->Release();
         }
         htm->Release();
     }
  delete pStreamAdapter;
   }
Re: Difference XP SP1 SP1a SP2 ??
#1577
Author: Bertrand Gorge
Date: Wed, 29 Sep 2004 12:17
26 lines
2139 bytes
Michael Krug <michael.krug*nospam*@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.

Bertrand
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