FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour Testar LPT1 no XP? Alguem conseguiu???
Posts: 1286
Joined: Mon Feb 25, 2008 02:54 PM
Testar LPT1 no XP? Alguem conseguiu???
Posted: Mon Aug 11, 2008 08:13 PM

Gente, antes de imprimir na LPT1 (XP) tentei de todo que é jeito testar a porta, para saber se a impressora esta preparada.

tentei com:

isprinter()
printerready()
printsend()
printstat()

e nada, não tem jeito.. será que testar a situação da LPT1 no XP é tão dificil assim?

Obrigado

ubiratanmga@gmail.com

FWH24.04
BCC7.3
HARBOUR3.2
xMate
Pelles´C
TDolphin
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Testar LPT1 no XP? Alguem conseguiu???
Posted: Thu Aug 14, 2008 07:13 AM
From Harbour's source code:
   {
      FHANDLE fhnd;
      
      if( pszPrinterName == NULL )
         pszPrinterName = "LPT1";

      fhnd = hb_fsOpen( ( BYTE * ) pszPrinterName, FO_WRITE | FO_SHARED | FO_PRIVATE );
      bIsPrinter = ( fhnd != FS_ERROR );
      hb_fsClose( fhnd );
   }

So basically you try to open "LPT1" as a file and check if you get a good return value.
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1286
Joined: Mon Feb 25, 2008 02:54 PM
Testar LPT1 no XP? Alguem conseguiu???
Posted: Thu Aug 14, 2008 11:20 AM
Sr. Antonio, não entendo ingles, poderia explicar-me como usar o código abaixo?
:-)

Antonio Linares wrote:From Harbour's source code:
   {
      FHANDLE fhnd;
      
      if( pszPrinterName == NULL )
         pszPrinterName = "LPT1";

      fhnd = hb_fsOpen( ( BYTE * ) pszPrinterName, FO_WRITE | FO_SHARED | FO_PRIVATE );
      bIsPrinter = ( fhnd != FS_ERROR );
      hb_fsClose( fhnd );
   }

So basically you try to open "LPT1" as a file and check if you get a good return value.
ubiratanmga@gmail.com

FWH24.04
BCC7.3
HARBOUR3.2
xMate
Pelles´C
TDolphin

Continue the discussion