Board index » cppbuilder » TCppWebBrowser calling multiple times?

TCppWebBrowser calling multiple times?


2007-03-26 03:02:04 AM
cppbuilder100
The following code worked fine for months:
//---------------------------------------------------------------------------
void __fastcall TRepairInformation::IndividualCimLoad(TIniTable& In){
TODBCConnStatement stmt(ConnControl);
static_string sql(1024);
dstring cimdata;
dstring cimqid;
if (!In["Dept"])In.Set("Dept",In["Default_S{*word*99}_Dept"]);
try{
cimqid = In["Cim_Id"];
cimdata=In["Assembly"];
stmt.ExecDirect("Insert into det(cimq_id,line_num,data)
values("+cimqid+",1,'"+cimdata+"')");
cimdata=In["Quantity"]+" - - US01 "+In["Dept"]+"-000";
stmt.ExecDirect("Insert into det(cimq_id,line_num,data)
values("+cimqid+",2,'"+cimdata+"')");
cimdata=In["Badge"]+" - - - - - - - "+In["Dept"];
stmt.ExecDirect("Insert into det(cimq_id,line_num,data)
values("+cimqid+",3,'"+cimdata+"')");
stmt.ExecDirect("Insert into det(cimq_id,line_num,data)
values("+cimqid+",4,'Y')");
CppWebBrowser1->Navigate(WideString(("oconee.itron.com/scripts/ocn-ex40.wsc/w1_mf088.p
//added this to s{*word*99} directly with Ravi's web page. 02-16-07 updated it on
02-19-07
} catch(TODBCError& E){
ShowMessage(E.Message);
ShowMessage(sql);
}
}
Ok, Ignore all the lead in {*word*99} and see if you can give me any indication
about the Navigate function, particularly with respect to calling this page
multiple times. I'm not sure it has, mind you, but it has been questioned. I
just want someone who might have a clue to end the question for good.
How many times can this function call the page using one Navigate call, i.e.
builtin retries, and what would the timing be between the calls.
Thanks.
V.
 
 

Re:TCppWebBrowser calling multiple times?

Sorry, forgot to say that the number of database entries was perfect,
showing that the Navigate function was called the right number of times.
Also forgot to say that the problem is that the other guys suspicion is that
the Navigate function called his web app three times a second a random
number of times.
My believe is that it probably can't but I am not able to set up a test that
could dispell the possibility, so I hope that someone would just know.
TIA.
V.
"Valence" < XXXX@XXXXX.COM >wrote in message
Quote
The following code worked fine for months:

//---------------------------------------------------------------------------

void __fastcall TRepairInformation::IndividualCimLoad(TIniTable& In){

TODBCConnStatement stmt(ConnControl);

static_string sql(1024);

dstring cimdata;

dstring cimqid;

if (!In["Dept"])In.Set("Dept",In["Default_S{*word*99}_Dept"]);

try{

cimqid = In["Cim_Id"];

cimdata=In["Assembly"];

stmt.ExecDirect("Insert into det(cimq_id,line_num,data)
values("+cimqid+",1,'"+cimdata+"')");

cimdata=In["Quantity"]+" - - US01 "+In["Dept"]+"-000";

stmt.ExecDirect("Insert into det(cimq_id,line_num,data)
values("+cimqid+",2,'"+cimdata+"')");

cimdata=In["Badge"]+" - - - - - - - "+In["Dept"];

stmt.ExecDirect("Insert into det(cimq_id,line_num,data)
values("+cimqid+",3,'"+cimdata+"')");

stmt.ExecDirect("Insert into det(cimq_id,line_num,data)
values("+cimqid+",4,'Y')");


CppWebBrowser1->Navigate(WideString(("oconee.itron.com/scripts/ocn-ex40.wsc/w1_mf088.p
//added this to s{*word*99} directly with Ravi's web page. 02-16-07 updated it
on 02-19-07

} catch(TODBCError& E){

ShowMessage(E.Message);

ShowMessage(sql);

}

}

Ok, Ignore all the lead in {*word*99} and see if you can give me any indication
about the Navigate function, particularly with respect to calling this
page multiple times. I'm not sure it has, mind you, but it has been
questioned. I just want someone who might have a clue to end the question
for good.

How many times can this function call the page using one Navigate call,
i.e. builtin retries, and what would the timing be between the calls.

Thanks.

V.


 

Re:TCppWebBrowser calling multiple times?

"Valence" < XXXX@XXXXX.COM >wrote in message
Quote
How many times can this function call the page using one Navigate
call
As many times as the web server tells it to.
Quote
what would the timing be between the calls.
There is no way to know that. Do keep in mind, though, that
Navigate() is an asynchronous operation. It returns right away. It
does not wait for the page to fully load first. That is what the
OnDocumentComplete event is for.
Gambit
 

{smallsort}

Re:TCppWebBrowser calling multiple times?

Thanks.
Quote
>How many times can this function call the page using one Navigate
call

As many times as the web server tells it to.

Please clarify. "web server" means that the Navigate function is not in
control of this? Navigate sends one and only one request?
We send the request, but do not care for the response, so we are not paying
attention to the OnDocumentComplete event.
TIA.
V.
 

Re:TCppWebBrowser calling multiple times?

"Valence" < XXXX@XXXXX.COM >wrote in message
Quote
Please clarify. "web server" means that the Navigate function is
not in control of this? Navigate sends one and only one request?
Navigate() sends an initial request to the server using the exact URL
that you specify in your code. The server's response could specify a
redirect to another URL that the client should go to next. This could
happen if the requested page has moved, the URL is incomplete and the
server is correcting it, the request was malformed and the server is
returning an error page, etc. It could also be that the server is
responding with a request for authentication, so Navigate() would then
send a second request to the original URL again with the
authentication information added to the request (after prompting the
user if needed).
Quote
We send the request, but do not care for the response, so we
are not paying attention to the OnDocumentComplete event.
Then why are you using TCppWebBrowser in the first place? It is a
visual component that wraps Internet Explorer. If you are not using
it for visual purposes, then you shouldn't be using it at all. If all
you want to do is send a request to the server, then you should be
using a non-visual HTTP component/library instead. Such as the HTTP
client component of the Indy, ICS, or Synapse component suites. Or
Microsoft's WinInet or WinHTTP APIs.
Gambit