🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.internet.web
6 messages
6 total messages Started by Danny Abbenhuis Thu, 01 Jun 2006 09:03
TCppWebrowser xml combination problems
#628
Author: Danny Abbenhuis
Date: Thu, 01 Jun 2006 09:03
46 lines
2834 bytes
I'm experiencing some problems using the TCppWebrowser component:

Request:

I'm writing a program that does some report printing on startup. It used 
some tables to create data in an xml file, and
one by one needs to print this data. For this I've used an TCppWebBrowser 
component to load the document
and in the ondocument complete I print the document and close the foprm on 
which it is shown. During startup a undefined number
of documents need to be printed.


Experience:

Written the code, i have seen several weird things:
- Sometime the application simply stops, and is gone
- Sometime an abnormal program termination occures
- Sometimes everything seems to be normal, the application finnishes 
printing, and continues
  with the normal user interface, but when at a later time closing the 
application al kind of weird errors
  occures (like unable to write to memmory)
- Using aqtime (because codeguard doesn't see any problems) it showed that 
there are lots of
  exceptions in calling the msxml3 dll file which probabbly is loaded. 
Possibly this is only the case
  in loading an xml file instead of a other standard url.

Testing:
To be able to test the situation I created a very simple program:
- i use the following code behind a button:
  CppWebBrowser1->Navigate(WideString("C:\\OwlSupplyReport.xml"));
- to automattically print the document when finnished :
  void __fastcall TForm1::CppWebBrowser1DocumentComplete(TObject *Sender,
   LPDISPATCH pDisp, Variant *URL)
{
  CppWebBrowser1->ExecWB( OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER, 0, 
0);
  CppWebBrowser1->Stop();
}
When pushing the button repeatedly, the application experiences the same 
problems as the original application

Does anyone know what might be the problem, is it a bug in my own code, a 
bug in the component, or a bug in the xml stuff.
Re: TCppWebrowser xml combination problems
#629
Author: Remy Lebeau (TeamB)
Date: Thu, 01 Jun 2006 09:17
13 lines
1300 bytes
"Danny Abbenhuis" <d_j_daan@hotmail.com> wrote in message
news:447eadbe@newsgroups.borland.com...

> For this I've used an TCppWebBrowser component to load the
> document and in the ondocument complete I print the document
> and close the foprm on which it is shown.

Why are you using TCppWebBrowser for that?  Why not just send the XML to the
printer directly?  Have you looked at the TPrinter class yet?


Gambit
Re: TCppWebrowser xml combination problems
#630
Author: Danny Abbenhuis
Date: Fri, 02 Jun 2006 05:50
22 lines
1822 bytes
Good question: we are using a webbrowser because the xml file to print 
contains stylesheets. Simply send the file to printer doesn't apply the 
stylesheets.

"Remy Lebeau (TeamB)" <no.spam@no.spam.com> schreef in bericht 
news:447eb24c$1@newsgroups.borland.com...
>
> "Danny Abbenhuis" <d_j_daan@hotmail.com> wrote in message
> news:447eadbe@newsgroups.borland.com...
>
>> For this I've used an TCppWebBrowser component to load the
>> document and in the ondocument complete I print the document
>> and close the foprm on which it is shown.
>
> Why are you using TCppWebBrowser for that?  Why not just send the XML to 
> the
> printer directly?  Have you looked at the TPrinter class yet?
>
>
> Gambit
>
> 
Re: TCppWebrowser xml combination problems
#632
Author: Remy Lebeau (TeamB)
Date: Fri, 02 Jun 2006 17:59
13 lines
1354 bytes
"Danny Abbenhuis" <d_j_daan@hotmail.com> wrote in message
news:447fd208@newsgroups.borland.com...

> we are using a webbrowser because the xml file to print
> contains stylesheets. Simply send the file to printer doesn't
> apply the stylesheets.

You could parse and apply the stylesheet manually when writing directly to
the printer..


Gambit
Re: TCppWebrowser xml combination problems
#633
Author: Danny Abbenhuis
Date: Tue, 06 Jun 2006 07:57
38 lines
2669 bytes
Sure, I'could and it would be a sollution, but it is not quit the one I am 
looking for. The sollution i use at this moment ought to work correctly and 
should not
give me any problems, it would be nice if anyone could tell me what the 
problem or give me alternative sollutions, other than parsing the file 
myself.

Offcourse i've done some more testing and it appears that whenever opening 
any xml file (also whithout stylesheets) that is larger than 4k gives 
problems at some point.
Sometimes the file can be openen over a hundred times seemingly without any 
problems, but at a certain point the application will crash, either after 
several time or after several hundreds of time.

Going into a deeper study of the problem I've used AQTime to check what 
exactely happens and it appears that whenever a xml file over 4k is opened 
in de webbrowser several exceptions are generated in  the msxml.dll file. 
Propebly these exceptions are handled in some way, because the application 
is able to continue, but at the end it goes wrong some time. When opening 
xml files under 4k nothing seems to be wrong.

"Remy Lebeau (TeamB)" <no.spam@no.spam.com> schreef in bericht 
news:44807fc6$3@newsgroups.borland.com...
>
> "Danny Abbenhuis" <d_j_daan@hotmail.com> wrote in message
> news:447fd208@newsgroups.borland.com...
>
>> we are using a webbrowser because the xml file to print
>> contains stylesheets. Simply send the file to printer doesn't
>> apply the stylesheets.
>
> You could parse and apply the stylesheet manually when writing directly to
> the printer..
>
>
> Gambit
>
> 
Re: TCppWebrowser xml combination problems
#636
Author: Danny Abbenhuis
Date: Thu, 08 Jun 2006 05:43
69 lines
3720 bytes
Remy, Thanxs for helping,

I have found some things on the internet regarding msxml3 problems, it 
states that whenever the internet explorer is closed after loading an xml 
file
the internet explorer might crash. This because it tries to free xml 
elements that do not exist anymore. This seems to be the problem in my 
application, since
the cppwebbrowser uses microsofts internet explorer.
I have applied the hotfixes for this problem, but that didn't help me out, 
but knowing what might be the problem, I changed my application in that the
form with the browser remains active without actually closing the 
cppwebbrowser. After doing this evrything runs smoothly.




"Danny Abbenhuis" <d_j_daan@hotmail.com> schreef in bericht 
news:447eadbe@newsgroups.borland.com...
> I'm experiencing some problems using the TCppWebrowser component:
>
> Request:
>
> I'm writing a program that does some report printing on startup. It used 
> some tables to create data in an xml file, and
> one by one needs to print this data. For this I've used an TCppWebBrowser 
> component to load the document
> and in the ondocument complete I print the document and close the foprm on 
> which it is shown. During startup a undefined number
> of documents need to be printed.
>
>
> Experience:
>
> Written the code, i have seen several weird things:
> - Sometime the application simply stops, and is gone
> - Sometime an abnormal program termination occures
> - Sometimes everything seems to be normal, the application finnishes 
> printing, and continues
>  with the normal user interface, but when at a later time closing the 
> application al kind of weird errors
>  occures (like unable to write to memmory)
> - Using aqtime (because codeguard doesn't see any problems) it showed that 
> there are lots of
>  exceptions in calling the msxml3 dll file which probabbly is loaded. 
> Possibly this is only the case
>  in loading an xml file instead of a other standard url.
>
> Testing:
> To be able to test the situation I created a very simple program:
> - i use the following code behind a button:
>  CppWebBrowser1->Navigate(WideString("C:\\OwlSupplyReport.xml"));
> - to automattically print the document when finnished :
>  void __fastcall TForm1::CppWebBrowser1DocumentComplete(TObject *Sender,
>   LPDISPATCH pDisp, Variant *URL)
> {
>  CppWebBrowser1->ExecWB( OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER, 0, 
> 0);
>  CppWebBrowser1->Stop();
> }
> When pushing the button repeatedly, the application experiences the same 
> problems as the original application
>
> Does anyone know what might be the problem, is it a bug in my own code, a 
> bug in the component, or a bug in the xml stuff.
>
>
>
> 
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