Powerbasic Museum 2020-B

Webmaster: José Roca (PBWIN 10+/PBCC 6+) (SDK Forum) => CSED Editor => Topic started by: Juergen Kuehlwein on August 06, 2014, 03:13:57 PM

Title: Print preview doesn´t work anymore
Post by: Juergen Kuehlwein on August 06, 2014, 03:13:57 PM
Hi Jose,

i added and changed a lot in CSED to meet my specific needs, but left CSED_princ.inc untouched so far. Print Preview isn´t working anymore now. In your original version it does work! So what could i have crashed elsewhere in order to make print preview not work anymore.

As far as i can tell the problem seems to be this line: (CSED_Print.inc)

  IHTMLDocument2_WriteString(pHTMLDocument2, strText)


"strtext" holds the expected data (this i can verify - the created html code shows without error in e.g. firefox), but it doesn´t show up in preview (print preview window shows up, but without code content).


I changed the main message pump (in CSED.bas - Winmain), could this be a problem ? I guess - No,  print preview uses it´s own ("pPrint.DoEvents") - right ?


There must be something else i changed and didn´t notice it´s dependency for print preview.


Maybe you could give me a hint which are the requirements for print preview to work.


Thanks

JK
Title: Re: Print preview doesn´t work anymore
Post by: Juergen Kuehlwein on August 06, 2014, 04:40:46 PM
Jose,

just replaced my file with your original file (CSED_Print.inc) - compiles, runs but doesn´t work either, I´m somewhat out of ideas, what could be wrong... (must be somewhere else).


Any help woulde be appreciated...


JK
Title: Re: Print preview doesn´t work anymore
Post by: Juergen Kuehlwein on August 06, 2014, 06:52:03 PM
Now i tried a workaround: save html data to a temporary file and use "pIWebBrowser2.Navigate2" like this:




  ...
  strUrl = "file:///" + EXE.PATH$ + "print.dat"
  vVar = strUrl

  pIWebBrowser2.Navigate2(vVar)



this is what i get:


Quote
Die XML-Seite kann nicht angezeigt werden
Die XML-Eingabe kann nicht angezeigt werden, wenn Stylesheet verwendet wird. Beheben Sie den Fehler und klicken Sie dann auf Aktualisieren oder wiederholen Sie den Vorgang später.


--------------------------------------------------------------------------------

Unbekannter Fehler Fehler beim Bearbeiten der Ressource 'http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd'.



meaning in short:
"This xml site cannot be shown - unknown error when processing 'http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd'. "



JK
Title: Re: Print preview doesn´t work anymore
Post by: Juergen Kuehlwein on August 06, 2014, 07:01:30 PM
Jose,


changing the file name from "print.dat" to print.htm" makes it work now like a charm (the workaround code). I still would like to know, why "IHTMLDocument2_WriteString(pHTMLDocument2, strText)" doesn´t work for me.


Thanks


JK
Title: Re: Print preview doesn´t work anymore
Post by: José Roca on August 07, 2014, 07:38:00 AM
Are you calling the print/preview dialog from a thread?
Title: Re: Print preview doesn´t work anymore
Post by: Theo Gottwald on August 08, 2014, 03:18:48 PM
Look here:
http://www.jose.it-berater.org/smfforum/index.php?topic=4671.0
I have added a afxDoEvents to solve it.
Title: Re: Print preview doesn´t work anymore
Post by: Juergen Kuehlwein on August 19, 2014, 11:39:29 PM
Back from a few days of hollyday...


Theo, Indeed this solves the whole issue for me as well!


Thanks,


JK