Testar LPT1 no XP? Alguem conseguiu???

Testar LPT1 no XP? Alguem conseguiu???

Postby MGA » Mon Aug 11, 2008 8: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
MGA
 
Posts: 1254
Joined: Mon Feb 25, 2008 2:54 pm
Location: Brasil/PR/Maringá

Postby Antonio Linares » Thu Aug 14, 2008 7:13 am

From Harbour's source code:
Code: Select all  Expand view  RUN
   {
      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
User avatar
Antonio Linares
Site Admin
 
Posts: 42160
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby MGA » Thu Aug 14, 2008 11:20 am

Sr. Antonio, não entendo ingles, poderia explicar-me como usar o código abaixo?
:D

Antonio Linares wrote:From Harbour's source code:
Code: Select all  Expand view  RUN
   {
      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
MGA
 
Posts: 1254
Joined: Mon Feb 25, 2008 2:54 pm
Location: Brasil/PR/Maringá


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 48 guests