Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Difference XP SP1 SP1a SP2 ??

2 views
Skip to first unread message

Michael Krug

unread,
Aug 27, 2004, 7:55:53 AM8/27/04
to
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;
}

Michael Krug

unread,
Aug 27, 2004, 8:36:53 AM8/27/04
to
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 ???

Michael Krug

unread,
Aug 27, 2004, 11:55:42 AM8/27/04
to
So, now i have played the new Service Pack 2 to the notebook. Now the
problem is the same on this notebook.

After removing this SP2, the software works without any problem ???

What can i do. I think this belongs to many other software.

Remy Lebeau (TeamB)

unread,
Aug 27, 2004, 3:33:23 PM8/27/04
to

"Michael Krug" <michael.krug*nospam*@utanet.at> wrote in message
news:412f2147$1...@newsgroups.borland.com...

> TMemoryStream* pMemStream=new TMemoryStream();
> if(pMemStream && pCppWebBrowser)

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.

> IPersistStreamInit* pPSI;
> IHTMLDocument2 *htm;

You should initialize your pointers to NULL.

> pMemStream->Seek(0, 0);

There is no need to seek an empty stream.

> if(!pCppWebBrowser->Document)
> {
> while(!pCppWebBrowser->Document)
> Application->ProcessMessages();
> }

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,(LP
VOID*)&htm))
> && (bool(htm))){

Why are you converting the interface pointer to a bool? You should not be
doing that.

Try this code instead:

#include <utilcls.h>
#include <memory>

if( pCppWebBrowser )
{
while( pCppWebBrowser->ReadyState != READYSTATE_COMPLETE )
Application->ProcessMessages();

TComInterface<IHTMLDocument2> htm;
pCppWebBrowser->Document->QueryInterface(IID_IHTMLDocument2,
(LPVOID*)&htm);
if( htm )
{
TComInterface<IPersistStreamInit> pPSI;
htm->QueryInterface(IID_IPersistStreamInit, (LPVOID*)&pPSI);
if( pPSI )
{
std::auto_ptr<TMemoryStream> MemStream(new TMemoryStream);
std::auto_ptr<TStreamAdapter> StreamAdapter(new
TStreamAdapter(MemStream.get(), soReference));
if( SUCCEEDED(pPSI->Save(*pStreamAdapter, FALSE)) )
{
// use pMemStream as needed...
}
}
}
}


Gambit


Michael Krug

unread,
Aug 30, 2004, 12:51:49 PM8/30/04
to
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?

Michael

Michael Krug

unread,
Aug 31, 2004, 11:48:06 AM8/31/04
to
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


Bertrand Gorge

unread,
Sep 29, 2004, 8:17:36 AM9/29/04
to
Michael Krug <michael.krug*nospam*@utanet.at> wrote in message news:<41349ded$1...@newsgroups.borland.com>...

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

0 new messages