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.

Erro em TPRINTER (memory buffer overflow)

Foro público de Xailer en español
User avatar
Marcelo Coelho Silva
Posts: 267
Joined: Sat May 31, 2008 4:49 pm

Erro em TPRINTER (memory buffer overflow)

Postby Marcelo Coelho Silva » Wed Dec 26, 2018 2:05 am

Prezados Senhores,

Tenho uma rotina (Procedure) a qual passo uma String a ser impressa através da Classe TPRINTER. Esta rotina vem funcionando a meses. Fiz algumas modificação no meu aplicativo, porem não mudei a rotina de impressão (que usa TPRINTER). Todo a vez que é enviado uma String a ser impressa, apresenta o erro descrito abaixo:

Application Internal Error - c:\Mhacker\bin\nfce_pdv.exe
Terminated at: 2018-12-25 22:53:32
Unrecoverable error 9022: Memory buffer overflow
Called from PRINTERCREATEDC(0)
Called from TPRINTER:STARTDOC(342) in Printer.prg
Called from IMPCUPOM(633) in C:\Users\Marcelo\Dropbox\PROJETOS\Software\Xailer50\NFCE_PDV\Source\Pdv_Lib.prg
Called from IMPCUPOMTEF(1007) in C:\Users\Marcelo\Dropbox\PROJETOS\Software\Xailer50\NFCE_PDV\Source\Pdv_Lib.prg
Called from TFORM1:TEFADM(1881) in C:\Users\Marcelo\Dropbox\PROJETOS\Software\Xailer50\NFCE_PDV\Source\Form1.prg
Called from TMENUITEM:ONCLICK(0) in Events.prg
Called from TMENU:DOACTION(253) in Menu.prg
Called from TMENU:DOACTION(258) in Menu.prg
Called from TFORM1:WMCOMMAND(945) in Form.prg
Called from RUNFORM(0)
Called from TAPPLICATION:RUN(287) in Application.prg
Called from MAIN(25) in C:\Users\Marcelo\Dropbox\PROJETOS\Software\Xailer50\NFCE_PDV\Source\nfce_pdv.prg
------------------------------------------------------------------------


Procedure ImpCupom( cBuffer, lPreView )

Local nTextLen, cLine, i, nTam, oFont

Default lPreView TO .f.

nTam := 48 // caracteres por linha na impressora

WITH OBJECT oFont := TFont():New()
// :cName := "Arial"
:cName := "Times New Roman"
:nSize := 8
:lBold := .t.
END WITH

With Object Printer
:lPreView := lPreView
:StartDoc() // ONDE O ERRO ESTA OCORRENDO
:oCanvas:nMapMode := mmSIMULCHAR
:StartPage()
End With

WITH OBJECT Printer:oCanvas
:oFont := oFont

----------------------------------------------------------------------------------------------------------
Att.

Marcelo Coelho Silva
Brasil.
User avatar
Hurricane
Posts: 112
Joined: Tue Mar 24, 2015 10:21 am
Location: Brasil
Contact:

Re: Erro em TPRINTER (memory buffer overflow)

Postby Hurricane » Sat Mar 09, 2019 6:05 pm

Marcelo,

crie um pequeno projeto exemplo demonstrando o problema, que tentarei ajudar.

obs: ao postar um código, selecione-o e clique no botão [code], além de facilitar a leitura, não produzirá Smilies.
Delphi [x]Harbour + GUI (all) | SQL FastReport
DevClub for Developers

Return to “Spanish”