Página 1 de 1

Print problem

Publicado: Mar Mar 07, 2006 12:14 pm
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

Print problem

Publicado: Mar Mar 07, 2006 9:16 pm
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
>

Print problem

Publicado: Mar Mar 07, 2006 9:16 pm
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
>

Print problem

Publicado: Mié Mar 08, 2006 10:32 am
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

Print problem

Publicado: Mié Mar 08, 2006 10:32 am
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

Print problem

Publicado: Mié Mar 08, 2006 12:12 pm
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)Â

Print problem

Publicado: Mié Mar 08, 2006 12:12 pm
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)Â

Print problem

Publicado: Mié Mar 08, 2006 12:45 pm
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

Print problem

Publicado: Mié Mar 08, 2006 12:45 pm
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

Print problem

Publicado: Mié Mar 08, 2006 2:07 pm
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)Â

Print problem

Publicado: Mié Mar 08, 2006 2:07 pm
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)Â

Print problem

Publicado: Mié Mar 08, 2006 2:50 pm
por Ingo Junge-Herrmann
Ignacio,
sorry I can't test it because "_hb_extIsObject" is missed. Have I include
some other libs?
Regards
Ingo

Print problem

Publicado: Mié Mar 08, 2006 2:50 pm
por Ingo Junge-Herrmann
Ignacio,
sorry I can't test it because "_hb_extIsObject" is missed. Have I include
some other libs?
Regards
Ingo

Print problem

Publicado: Mié Mar 08, 2006 4:30 pm
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)Â

Print problem

Publicado: Mié Mar 08, 2006 4:30 pm
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)Â

Print problem

Publicado: Mié Mar 08, 2006 5:00 pm
por Ingo Junge-Herrmann
Ignacio,
now it works ;-)!!!!!
Gratulation.
Ingo

Print problem

Publicado: Mié Mar 08, 2006 5:00 pm
por Ingo Junge-Herrmann
Ignacio,
now it works ;-)!!!!!
Gratulation.
Ingo

Print problem

Publicado: Mié Mar 08, 2006 6:58 pm
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

Print problem

Publicado: Mié Mar 08, 2006 6:58 pm
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