In order for this site to work correctly we need to store a small file (called a cookie) on your computer. Most every site in the world does this, however since the 25th of May 2011, by law we have to get your permission first. Please abandon the forum if you disagree.

Para que este foro funcione correctamente es necesario guardar un pequeño fichero (llamado cookie) en su ordenador. La mayoría de los sitios de Internet lo hacen, no obstante desde el 25 de Marzo de 2011 y por ley, necesitamos de su permiso con antelación. Abandone este foro si no está conforme.

Print problem

Xailer professional forum in English
Responder
Ingo Junge-Herrmann
Mensajes: 339
Registrado: Lun Jul 02, 2007 7:17 pm

Print problem

Mensaje por Ingo Junge-Herrmann »

Ignacio,
the code works:
WITH OBJECT Printer:oCanvas
:oFont:=oFont
:nMapMode:=mmHIMETRICS
ProcessMessages()
For nX:=1 TO LEN(a_nmbCm)
aPix[nX]:=:PointToPixels((a_nmbCm[nX,2]*100)+nLeft,;
(a_nmbCm[nX,1]*100)+nTop)
ProcessMessages()
next
:nMapMode:=mmPIXELS
END WITH
Without the both ProcessMessages() the reported error occurs.
With the calls it works!
Regards
Ingo
Guest

Print problem

Mensaje por Guest »

Ingo,
Thingking on your problem. I guess and hope I found the problem:
You are calling TCanvas methods without creating a document with
TPrinter:StartDoc(). For that reason, there is no DC available when calling
the method TCanvas:Whatever(). On those cases the TCanvas creates a
temporary DC and then deletes it. But the problem is that you are doing that
task on a for..next loop and the printer driver does not have the enough
time to close the DC when it receives a new DC creation. Thats way the
ProcessMessages() solves your problem.
Simply put your loop after the Printer:StartDoc() method. That's all.
Regards,
"Ingo Junge-Herrmann" <[email=XPRO-0031BA74-01@10.0.0.11]XPRO-0031BA74-01@10.0.0.11[/email]> escribió en el mensaje
news:440d6b14$[email=1@ozsrvnegro.ozlan.local...]1@ozsrvnegro.ozlan.local...[/email]
>
> Ignacio,
>
> the code works:
>
> WITH OBJECT Printer:oCanvas
> :oFont:=oFont
> :nMapMode:=mmHIMETRICS
> ProcessMessages()
> For nX:=1 TO LEN(a_nmbCm)
> aPix[nX]:=:PointToPixels((a_nmbCm[nX,2]*100)+nLeft,;
> (a_nmbCm[nX,1]*100)+nTop)
> ProcessMessages()
> next
> :nMapMode:=mmPIXELS
> END WITH
>
> Without the both ProcessMessages() the reported error occurs.
> With the calls it works!
>
> Regards
>
> Ingo
>
iozuniga
Mensajes: 1
Registrado: Mar Mar 07, 2006 9:16 pm

Print problem

Mensaje por iozuniga »

Ingo,
Thingking on your problem. I guess and hope I found the problem:
You are calling TCanvas methods without creating a document with
TPrinter:StartDoc(). For that reason, there is no DC available when calling
the method TCanvas:Whatever(). On those cases the TCanvas creates a
temporary DC and then deletes it. But the problem is that you are doing that
task on a for..next loop and the printer driver does not have the enough
time to close the DC when it receives a new DC creation. Thats way the
ProcessMessages() solves your problem.
Simply put your loop after the Printer:StartDoc() method. That's all.
Regards,
"Ingo Junge-Herrmann" <[email=XPRO-0031BA74-01@10.0.0.11]XPRO-0031BA74-01@10.0.0.11[/email]> escribió en el mensaje
news:440d6b14$[email=1@ozsrvnegro.ozlan.local...]1@ozsrvnegro.ozlan.local...[/email]
>
> Ignacio,
>
> the code works:
>
> WITH OBJECT Printer:oCanvas
> :oFont:=oFont
> :nMapMode:=mmHIMETRICS
> ProcessMessages()
> For nX:=1 TO LEN(a_nmbCm)
> aPix[nX]:=:PointToPixels((a_nmbCm[nX,2]*100)+nLeft,;
> (a_nmbCm[nX,1]*100)+nTop)
> ProcessMessages()
> next
> :nMapMode:=mmPIXELS
> END WITH
>
> Without the both ProcessMessages() the reported error occurs.
> With the calls it works!
>
> Regards
>
> Ingo
>
Ingo Junge-Herrmann
Mensajes: 339
Registrado: Lun Jul 02, 2007 7:17 pm

Print problem

Mensaje por Ingo Junge-Herrmann »

"Ignacio Ortiz de Zúñiga" <iozuniga@ozs.com> wrote:
Ignacio,
thanks for your effort.
>You are calling TCanvas methods without creating a document with
>TPrinter:StartDoc().
No, :StartDoc() is called before, here the complete code without the :TextOut-lines
IF !Printer:Setup()
RETURN .F.
ENDIF
WITH OBJECT oFont:=TFont():New()
:cName := "Courier New"
:nSize := 10
:lBold := .t.
END WITH
Printer:lPreview:=.T.
Printer:StartDoc("Normal-Mahnbescheid")
WITH OBJECT Printer:oCanvas
:oFont:=oFont
:nMapMode:=mmHIMETRICS
For nX:=1 TO LEN(a_nmbCm)
aPix[nX]:=:PointToPixels((a_nmbCm[nX,2]*100)+nLeft,(a_nmbCm[ nX,1]*100)+nTop)
next
:nMapMode:=mmPIXELS
END WITH
for nZahl:=1 to nAnzahl
Printer:StartPage()
WITH OBJECT Printer:oCanvas
for nX:=1 TO Len(aMB)
.....
.....
next
END WITH
Printer:EndPage()
next
Printer:EndDoc()
Printer:Preview()
oFont:End()
Meanwhile I found the reason.
The error happens only if the Canon IP4000 is selected. For this printer
is a very large driver installed.
When I started my application outside of Xailers IDE all is ok.
Running the app from the IDE than the error occurs.
Is it possible that the heap of the running app will be manipulated by the
IDE? See the LogDebug lines:
#1: HEAP[mwin.exe]:
#2: Heap block at 001DE828 modified at 001DE90C past requested size of dc
#3: HEAP[mwin.exe]:
#4: Invalid Address specified to RtlFreeHeap( 00150000, 001DE830 )
Maybe this messages will help you, for me is it primary important that my
application will be running outside the IDE without any error.
Regards
Ingo
Ingo Junge-Herrmann
Mensajes: 339
Registrado: Lun Jul 02, 2007 7:17 pm

Print problem

Mensaje por Ingo Junge-Herrmann »

"Ignacio Ortiz de Zúñiga" <iozuniga@ozs.com> wrote:
Ignacio,
thanks for your effort.
>You are calling TCanvas methods without creating a document with
>TPrinter:StartDoc().
No, :StartDoc() is called before, here the complete code without the :TextOut-lines
IF !Printer:Setup()
RETURN .F.
ENDIF
WITH OBJECT oFont:=TFont():New()
:cName := "Courier New"
:nSize := 10
:lBold := .t.
END WITH
Printer:lPreview:=.T.
Printer:StartDoc("Normal-Mahnbescheid")
WITH OBJECT Printer:oCanvas
:oFont:=oFont
:nMapMode:=mmHIMETRICS
For nX:=1 TO LEN(a_nmbCm)
aPix[nX]:=:PointToPixels((a_nmbCm[nX,2]*100)+nLeft,(a_nmbCm[ nX,1]*100)+nTop)
next
:nMapMode:=mmPIXELS
END WITH
for nZahl:=1 to nAnzahl
Printer:StartPage()
WITH OBJECT Printer:oCanvas
for nX:=1 TO Len(aMB)
.....
.....
next
END WITH
Printer:EndPage()
next
Printer:EndDoc()
Printer:Preview()
oFont:End()
Meanwhile I found the reason.
The error happens only if the Canon IP4000 is selected. For this printer
is a very large driver installed.
When I started my application outside of Xailers IDE all is ok.
Running the app from the IDE than the error occurs.
Is it possible that the heap of the running app will be manipulated by the
IDE? See the LogDebug lines:
#1: HEAP[mwin.exe]:
#2: Heap block at 001DE828 modified at 001DE90C past requested size of dc
#3: HEAP[mwin.exe]:
#4: Invalid Address specified to RtlFreeHeap( 00150000, 001DE830 )
Maybe this messages will help you, for me is it primary important that my
application will be running outside the IDE without any error.
Regards
Ingo
Avatar de Usuario
ignacio
Site Admin
Mensajes: 9253
Registrado: Lun Abr 06, 2015 8:00 pm
Ubicación: Madrid, Spain
Contactar:

Print problem

Mensaje por ignacio »

Ingo,
Could you try with the file I have just attach.
Thanks.
"Ingo Junge-Herrmann" <[email=XPRO-0031BA74-01@10.0.0.11]XPRO-0031BA74-01@10.0.0.11[/email]> escribió en el mensaje
news:440ea4ac$[email=1@ozsrvnegro.ozlan.local...]1@ozsrvnegro.ozlan.local...[/email]
>
> "Ignacio Ortiz de Zúñiga" <iozuniga@ozs.com> wrote:
> Ignacio,
>
> thanks for your effort.
>
>>You are calling TCanvas methods without creating a document with
>>TPrinter:StartDoc().
>
> No, :StartDoc() is called before, here the complete code without the
> :TextOut-lines
>
> IF !Printer:Setup()
> RETURN .F.
> ENDIF
> WITH OBJECT oFont:=TFont():New()
> :cName := "Courier New"
> :nSize := 10
> :lBold := .t.
> END WITH
> Printer:lPreview:=.T.
> Printer:StartDoc("Normal-Mahnbescheid")
> WITH OBJECT Printer:oCanvas
> :oFont:=oFont
> :nMapMode:=mmHIMETRICS
> For nX:=1 TO LEN(a_nmbCm)
>
> aPix[nX]:=:PointToPixels((a_nmbCm[nX,2]*100)+nLeft,(a_nmbCm[ nX,1]*100)+nTop)
> next
> :nMapMode:=mmPIXELS
> END WITH
> for nZahl:=1 to nAnzahl
> Printer:StartPage()
> WITH OBJECT Printer:oCanvas
> for nX:=1 TO Len(aMB)
> .....
> .....
> next
> END WITH
> Printer:EndPage()
> next
> Printer:EndDoc()
> Printer:Preview()
> oFont:End()
>
> Meanwhile I found the reason.
>
> The error happens only if the Canon IP4000 is selected. For this printer
> is a very large driver installed.
>
> When I started my application outside of Xailers IDE all is ok.
> Running the app from the IDE than the error occurs.
>
> Is it possible that the heap of the running app will be manipulated by the
> IDE? See the LogDebug lines:
>
> #1: HEAP[mwin.exe]:
> #2: Heap block at 001DE828 modified at 001DE90C past requested size of dc
> #3: HEAP[mwin.exe]:
> #4: Invalid Address specified to RtlFreeHeap( 00150000, 001DE830 )
>
> Maybe this messages will help you, for me is it primary important that my
> application will be running outside the IDE without any error.
>
> Regards
>
> Ingo
>


Attached files ICanvas.rar (3.2 KB)Â
Ignacio Ortiz de Zúñiga
[Equipo de Xailer / Xailer team]
https://www.xailer.com
NoName
Mensajes: 531
Registrado: Vie Feb 03, 2006 7:27 pm

Print problem

Mensaje por NoName »

Ingo,
Could you try with the file I have just attach.
Thanks.
"Ingo Junge-Herrmann" <[email=XPRO-0031BA74-01@10.0.0.11]XPRO-0031BA74-01@10.0.0.11[/email]> escribió en el mensaje
news:440ea4ac$[email=1@ozsrvnegro.ozlan.local...]1@ozsrvnegro.ozlan.local...[/email]
>
> "Ignacio Ortiz de Zúñiga" <iozuniga@ozs.com> wrote:
> Ignacio,
>
> thanks for your effort.
>
>>You are calling TCanvas methods without creating a document with
>>TPrinter:StartDoc().
>
> No, :StartDoc() is called before, here the complete code without the
> :TextOut-lines
>
> IF !Printer:Setup()
> RETURN .F.
> ENDIF
> WITH OBJECT oFont:=TFont():New()
> :cName := "Courier New"
> :nSize := 10
> :lBold := .t.
> END WITH
> Printer:lPreview:=.T.
> Printer:StartDoc("Normal-Mahnbescheid")
> WITH OBJECT Printer:oCanvas
> :oFont:=oFont
> :nMapMode:=mmHIMETRICS
> For nX:=1 TO LEN(a_nmbCm)
>
> aPix[nX]:=:PointToPixels((a_nmbCm[nX,2]*100)+nLeft,(a_nmbCm[ nX,1]*100)+nTop)
> next
> :nMapMode:=mmPIXELS
> END WITH
> for nZahl:=1 to nAnzahl
> Printer:StartPage()
> WITH OBJECT Printer:oCanvas
> for nX:=1 TO Len(aMB)
> .....
> .....
> next
> END WITH
> Printer:EndPage()
> next
> Printer:EndDoc()
> Printer:Preview()
> oFont:End()
>
> Meanwhile I found the reason.
>
> The error happens only if the Canon IP4000 is selected. For this printer
> is a very large driver installed.
>
> When I started my application outside of Xailers IDE all is ok.
> Running the app from the IDE than the error occurs.
>
> Is it possible that the heap of the running app will be manipulated by the
> IDE? See the LogDebug lines:
>
> #1: HEAP[mwin.exe]:
> #2: Heap block at 001DE828 modified at 001DE90C past requested size of dc
> #3: HEAP[mwin.exe]:
> #4: Invalid Address specified to RtlFreeHeap( 00150000, 001DE830 )
>
> Maybe this messages will help you, for me is it primary important that my
> application will be running outside the IDE without any error.
>
> Regards
>
> Ingo
>


Attached files ICanvas.rar (3.2 KB)Â
Ingo Junge-Herrmann
Mensajes: 339
Registrado: Lun Jul 02, 2007 7:17 pm

Print problem

Mensaje por Ingo Junge-Herrmann »

Ignacio,
it doesn't work. The error occurs now at the first try to print with this
LogDebug-messages:
#1: HEAP[mwin.exe]:
#2: Heap block at 001DC148 modified at 001DC22C past requested size of dc
#3: HEAP[mwin.exe]:
#4: Invalid Address specified to RtlFreeHeap( 00150000, 001DC150 )
#5: Heap corruption detected at 001DC248
#6: Heap corruption detected at 001DC248
#7: Heap corruption detected at 001DC480
Regards
Ingo
Ingo Junge-Herrmann
Mensajes: 339
Registrado: Lun Jul 02, 2007 7:17 pm

Print problem

Mensaje por Ingo Junge-Herrmann »

Ignacio,
it doesn't work. The error occurs now at the first try to print with this
LogDebug-messages:
#1: HEAP[mwin.exe]:
#2: Heap block at 001DC148 modified at 001DC22C past requested size of dc
#3: HEAP[mwin.exe]:
#4: Invalid Address specified to RtlFreeHeap( 00150000, 001DC150 )
#5: Heap corruption detected at 001DC248
#6: Heap corruption detected at 001DC248
#7: Heap corruption detected at 001DC480
Regards
Ingo
Avatar de Usuario
ignacio
Site Admin
Mensajes: 9253
Registrado: Lun Abr 06, 2015 8:00 pm
Ubicación: Madrid, Spain
Contactar:

Print problem

Mensaje por ignacio »

Ingo,
I believe is fixed. Try with the modules I attach with this message.
Regards,
Note: I have donwload Canon driver and try your sample and here is working
fine. BTW, I could not test it before the modifications since I read your
message to José when the modifications were all done.
"Ingo Junge-Herrmann" <[email=XPRO-0031BA74-01@10.0.0.11]XPRO-0031BA74-01@10.0.0.11[/email]> escribió en el mensaje
news:[email=440ec3dd@ozsrvnegro.ozlan.local...]440ec3dd@ozsrvnegro.ozlan.local...[/email]
>
> Ignacio,
>
> it doesn't work. The error occurs now at the first try to print with this
> LogDebug-messages:
>
> #1: HEAP[mwin.exe]:
> #2: Heap block at 001DC148 modified at 001DC22C past requested size of dc
> #3: HEAP[mwin.exe]:
> #4: Invalid Address specified to RtlFreeHeap( 00150000, 001DC150 )
> #5: Heap corruption detected at 001DC248
> #6: Heap corruption detected at 001DC248
> #7: Heap corruption detected at 001DC480
>
> Regards
>
> Ingo
>


Attached files Printer.rar (21.5 KB)Â
Ignacio Ortiz de Zúñiga
[Equipo de Xailer / Xailer team]
https://www.xailer.com
NoName
Mensajes: 531
Registrado: Vie Feb 03, 2006 7:27 pm

Print problem

Mensaje por NoName »

Ingo,
I believe is fixed. Try with the modules I attach with this message.
Regards,
Note: I have donwload Canon driver and try your sample and here is working
fine. BTW, I could not test it before the modifications since I read your
message to José when the modifications were all done.
"Ingo Junge-Herrmann" <[email=XPRO-0031BA74-01@10.0.0.11]XPRO-0031BA74-01@10.0.0.11[/email]> escribió en el mensaje
news:[email=440ec3dd@ozsrvnegro.ozlan.local...]440ec3dd@ozsrvnegro.ozlan.local...[/email]
>
> Ignacio,
>
> it doesn't work. The error occurs now at the first try to print with this
> LogDebug-messages:
>
> #1: HEAP[mwin.exe]:
> #2: Heap block at 001DC148 modified at 001DC22C past requested size of dc
> #3: HEAP[mwin.exe]:
> #4: Invalid Address specified to RtlFreeHeap( 00150000, 001DC150 )
> #5: Heap corruption detected at 001DC248
> #6: Heap corruption detected at 001DC248
> #7: Heap corruption detected at 001DC480
>
> Regards
>
> Ingo
>


Attached files Printer.rar (21.5 KB)Â
Ingo Junge-Herrmann
Mensajes: 339
Registrado: Lun Jul 02, 2007 7:17 pm

Print problem

Mensaje por Ingo Junge-Herrmann »

Ignacio,
sorry I can't test it because "_hb_extIsObject" is missed. Have I include
some other libs?
Regards
Ingo
Ingo Junge-Herrmann
Mensajes: 339
Registrado: Lun Jul 02, 2007 7:17 pm

Print problem

Mensaje por Ingo Junge-Herrmann »

Ignacio,
sorry I can't test it because "_hb_extIsObject" is missed. Have I include
some other libs?
Regards
Ingo
Avatar de Usuario
ignacio
Site Admin
Mensajes: 9253
Registrado: Lun Abr 06, 2015 8:00 pm
Ubicación: Madrid, Spain
Contactar:

Print problem

Mensaje por ignacio »

Ingo,
That function is part of the new xHarbour binaries that will be included on
PR7. I have just recompiled the modules with xHarbour PR6B binaries. I hope
it works now. In case not, I am afraid you will have to wait to PR7.
Thank you for your feedback.
Regards,
"Ingo Junge-Herrmann" <[email=XPRO-0031BA74-01@10.0.0.11]XPRO-0031BA74-01@10.0.0.11[/email]> escribió en el mensaje
news:440ee10f$[email=1@ozsrvnegro.ozlan.local...]1@ozsrvnegro.ozlan.local...[/email]
>
> Ignacio,
>
> sorry I can't test it because "_hb_extIsObject" is missed. Have I include
> some other libs?
>
> Regards
>
> Ingo


Attached files Printer.rar (21.5 KB)Â
Ignacio Ortiz de Zúñiga
[Equipo de Xailer / Xailer team]
https://www.xailer.com
NoName
Mensajes: 531
Registrado: Vie Feb 03, 2006 7:27 pm

Print problem

Mensaje por NoName »

Ingo,
That function is part of the new xHarbour binaries that will be included on
PR7. I have just recompiled the modules with xHarbour PR6B binaries. I hope
it works now. In case not, I am afraid you will have to wait to PR7.
Thank you for your feedback.
Regards,
"Ingo Junge-Herrmann" <[email=XPRO-0031BA74-01@10.0.0.11]XPRO-0031BA74-01@10.0.0.11[/email]> escribió en el mensaje
news:440ee10f$[email=1@ozsrvnegro.ozlan.local...]1@ozsrvnegro.ozlan.local...[/email]
>
> Ignacio,
>
> sorry I can't test it because "_hb_extIsObject" is missed. Have I include
> some other libs?
>
> Regards
>
> Ingo


Attached files Printer.rar (21.5 KB)Â
Ingo Junge-Herrmann
Mensajes: 339
Registrado: Lun Jul 02, 2007 7:17 pm

Print problem

Mensaje por Ingo Junge-Herrmann »

Ignacio,
now it works ;-)!!!!!
Gratulation.
Ingo
Ingo Junge-Herrmann
Mensajes: 339
Registrado: Lun Jul 02, 2007 7:17 pm

Print problem

Mensaje por Ingo Junge-Herrmann »

Ignacio,
now it works ;-)!!!!!
Gratulation.
Ingo
Avatar de Usuario
ignacio
Site Admin
Mensajes: 9253
Registrado: Lun Abr 06, 2015 8:00 pm
Ubicación: Madrid, Spain
Contactar:

Print problem

Mensaje por ignacio »

Ingo,
Great news. Thanks for your feedback.
Regards,
"Ingo Junge-Herrmann" <[email=XPRO-0031BA74-01@10.0.0.11]XPRO-0031BA74-01@10.0.0.11[/email]> escribió en el mensaje
news:440eff82$[email=1@ozsrvnegro.ozlan.local...]1@ozsrvnegro.ozlan.local...[/email]
>
> Ignacio,
>
> now it works ;-)!!!!!
>
> Gratulation.
>
> Ingo
Ignacio Ortiz de Zúñiga
[Equipo de Xailer / Xailer team]
https://www.xailer.com
NoName
Mensajes: 531
Registrado: Vie Feb 03, 2006 7:27 pm

Print problem

Mensaje por NoName »

Ingo,
Great news. Thanks for your feedback.
Regards,
"Ingo Junge-Herrmann" <[email=XPRO-0031BA74-01@10.0.0.11]XPRO-0031BA74-01@10.0.0.11[/email]> escribió en el mensaje
news:440eff82$[email=1@ozsrvnegro.ozlan.local...]1@ozsrvnegro.ozlan.local...[/email]
>
> Ignacio,
>
> now it works ;-)!!!!!
>
> Gratulation.
>
> Ingo
Responder