🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.internet.web
Article #249

Re: TCPPWebBrowser SLOW for a certain time of day

#249
From: Hans Galema
Date: Tue, 06 Feb 2007 17:00
130 lines
3991 bytes
Eduardo Jauch wrote:

> The same pages are download in about 2 seconds in firefox, while in IE 
> can take to 2 minutes!!!!!!!!!

So TCppWebBRowser is slow, IE is slow and Firefox is fast.

> Was not my code I think, but anyway, I do this:

> void TjanelaPrincipal::CarregarFrame(WideString url)
> {
>   TVariant FrameName( "iContent" );
> 
>   paginaCarregada = false;
>   Browser->Navigate( url, TNoParam(), &FrameName );
> 
>   while( !paginaCarregada )
>   {
>     Application->ProcessMessages();
>   }
> }

Is that code that loads a htmppage in one of the frames of an existing
page? Why didn't you tell?

What is the use of paginaCarregada ? I think you can omit it all the way.

And at least the loop with  Application->ProcessMessages(); looks not needed.

> void __fastcall TjanelaPrincipal::BrowserNavigateComplete2(TObject *Sender,
>       LPDISPATCH pDisp, Variant *URL)
> {
>   if (!CurDispatch)
>     CurDispatch = pDisp;
> }

You did explain nothing of CurDispath? What is it? Where did you assign it?
Why this code?


> void __fastcall TjanelaPrincipal::BrowserDocumentComplete(TObject *Sender,
>       LPDISPATCH pDisp, Variant *URL)
> {
>   if (pDisp == CurDispatch)
>   {
>     CurDispatch = NULL;
> 
>     FrameDoc = Frame( WideString("iContent") );

You did not explain the function Frame().
> 
>     if( FrameDoc )
>       FrameDoc->get_all( &All );
>     else
>     {
>       ShowMessage("ERRO!!! \'Frame\' n�o encontrado!");

You are making a return without

	paginaCarregada = true;

>       return;
>     }
> 
>     if( !All )
>     {
>       FrameDoc->Release();
>       ShowMessage("ERRO!!! \'All\' n�o encontrado!");

You are making a return without

	paginaCarregada = true;

>       return;
>     }
> 
>     paginaCarregada = true;
>   }
>   else
>   {
>     paginaCarregada = false;
>   }
> }
> 
> 
> Any better ideas to do this?

Well you never told what you wanted to happen, nor explained the
start of the scenario.

> I cannot put my code direct in BrowserDocumentComplete, for various 
> reasons....

Should we guess?

> One is that I use this code:
> 
> int TjanelaPrincipal::Agendamento(void)

You did not tell where/when you call that function

> {
>   IDispatch *pDisp;
>   IHTMLInputElement *pInput;
>   IHTMLSelectElement *pSelect;
>   IHTMLOptionElement *pOption;
>   TAGIntervalo *pIntervalo;
>   WideString opcao;
>   AnsiString qtde;
>   long pItens;
>   int i, m, d, h, qtde_n;

That looks like C programming. Why not declare the variables at the
moment where you first use them?

>   meses.Reiniciar();
>   datas.Reiniciar();

We do not see what that code does.

>   pSelect = SelectElement("mesDisponivel");

You did not explain that function nor the rest of the code.

> Any ideas???

You would be better off if you managed to produce a htmlpage
that you could put on the internet and that we could use too.

Hans.
Technical Details
Message-ID: <45c8b4ee@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <45c8ad84@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: feeec,19ca628026a7cd6e
X-Google-Attributes: gidfeeec,public
X-Google-Language: ENGLISH,ASCII
Date: Tue, 06 Feb 2007 18:00:39 +0100
From: Hans Galema <notused@notused.nl>
User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.internet.web
Subject: Re: TCPPWebBrowser SLOW for a certain time of day
References: <45c8ad84@newsgroups.borland.com>
In-Reply-To: <45c8ad84@newsgroups.borland.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit
NNTP-Posting-Host: 145.98.201.248
Message-ID: <45c8b4ee@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1170781422 145.98.201.248 (6 Feb 2007 09:03:42 -0800)
Lines: 130
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail