TDOSPRN y XP WINDOWS

TDOSPRN y XP WINDOWS

Postby Armando Picon » Wed Jan 19, 2011 5:09 pm

Amigos

Como una practica de trabajo normal, toda aplicaciòn la inicio en W98SE, en una vieja Pentium I. Esta pràctica me ha permitido realizar trozos pequeños de codigo en un ambiente limitado para que, posteriormente, pueda operar a alta velocidad en "ambientes màs grandes".

Hace poco, algunos clientes me han indicado que algunos reportes, en equipos que operan en XP SP2, SP3 NO IMPRIMEN NADA!. Estoy revisando dichos reportes y, en ellas, he utilizado la clase TDOSPRN en razòn que deben ser emitidos si o si en IMPRESORAS MATRICIALES (EPSON).

En el foro he visto que hubo consultas respecto a que XP impide la salida de comandos directamente a la impresora. La pregunta es ¿como superaron el inconveniente?. Acepto todas las sugerencias... para seguir utilizando TDOSPRN en XP.

Saludos

Armando
FWH + BCC582 + WorkShop 4.5 + Resource Hacker + Mingw
Mis nuevas herramientas
Comunicacion via WhatsApp (+51) 957549 665
Comunicación via Correo: apic1002002 at yahoo dot es; apic1002002@gmail.com
User avatar
Armando Picon
 
Posts: 446
Joined: Mon Dec 26, 2005 9:11 pm
Location: Lima, Peru

Re: TDOSPRN y XP WINDOWS

Postby Armando Picon » Fri Jan 21, 2011 6:12 pm

¡Upsss! ¿ninguno utiliza Tdosprn?
FWH + BCC582 + WorkShop 4.5 + Resource Hacker + Mingw
Mis nuevas herramientas
Comunicacion via WhatsApp (+51) 957549 665
Comunicación via Correo: apic1002002 at yahoo dot es; apic1002002@gmail.com
User avatar
Armando Picon
 
Posts: 446
Joined: Mon Dec 26, 2005 9:11 pm
Location: Lima, Peru

Re: TDOSPRN y XP WINDOWS

Postby sysctrl2 » Fri Jan 21, 2011 8:12 pm

Armndo, claro que si, creo que la mayoria en mi caso no he tenido ningun problema
para usar tdosprn + windows, tengo aplicaciones que trabajan en xp, vista, win7,
sin problemas.
Cesar Cortes Cruz
SysCtrl Software
Mexico

' Sin +- FWH es mejor "
User avatar
sysctrl2
 
Posts: 951
Joined: Mon Feb 05, 2007 7:15 pm

Re: TDOSPRN y XP WINDOWS

Postby Armando Picon » Fri Jan 21, 2011 10:42 pm

Y entonces... ¿què puede estar pasando? Tengo los fuentes originales, los he vuelto a generar en mi XP-SP2 (regresè de SP3) y no funciona. Lo llevè a W98SE y todo bien. ¿Alguna pista?
FWH + BCC582 + WorkShop 4.5 + Resource Hacker + Mingw
Mis nuevas herramientas
Comunicacion via WhatsApp (+51) 957549 665
Comunicación via Correo: apic1002002 at yahoo dot es; apic1002002@gmail.com
User avatar
Armando Picon
 
Posts: 446
Joined: Mon Dec 26, 2005 9:11 pm
Location: Lima, Peru

Re: TDOSPRN y XP WINDOWS

Postby sysctrl2 » Sat Jan 22, 2011 8:23 pm

te comento, lo que yo hago, es un poco antiguo pero me funciona,

partiendo de que la impresora es una de matriz,

1. comparto la impresora
2. creo un LPT1.BAT con los siguientes parametros.

NET USE LPT1: /DELETE
NET USE LPT1: \\nombre\nom_impresora /persistent:yes

3. ejecutas el archivo por lotes.

4. pruebas desde ventana de comandos,

DIR >LPT1 y si envia informacion a la impresora quiere decir que tu sistema imprimira sin ningun problema.

saludos..
Cesar Cortes Cruz
SysCtrl Software
Mexico

' Sin +- FWH es mejor "
User avatar
sysctrl2
 
Posts: 951
Joined: Mon Feb 05, 2007 7:15 pm

Re: TDOSPRN y XP WINDOWS

Postby Armando Picon » Sat Jan 22, 2011 10:07 pm

Cèsar

Gracias por el tip. Voy a probar y en caso no resultara, lo comento nuevamente.

Saludos

Armando
FWH + BCC582 + WorkShop 4.5 + Resource Hacker + Mingw
Mis nuevas herramientas
Comunicacion via WhatsApp (+51) 957549 665
Comunicación via Correo: apic1002002 at yahoo dot es; apic1002002@gmail.com
User avatar
Armando Picon
 
Posts: 446
Joined: Mon Dec 26, 2005 9:11 pm
Location: Lima, Peru

Re: TDOSPRN y XP WINDOWS

Postby Armando Picon » Sun Jan 23, 2011 1:19 am

Cesar

Probè el tip que señalas. No me funca y me arroja un mensaje de error tipo "sistema 62". (en buen romance no existe la red LPT1 --- Instruccion: NET USE LPT1: /DELETE). Mi equipo no se encuentra formando parte de ninguna red.

Si abro la ventana de comandos, sin hacer ninguna oparaciòn con NET, el comando DIR > LPT1 funciona correctamente y me imprime el contenido de la carpeta donde estoy posicionado.

¿Alguna otra sugerencia?

Saludos

Armando
FWH + BCC582 + WorkShop 4.5 + Resource Hacker + Mingw
Mis nuevas herramientas
Comunicacion via WhatsApp (+51) 957549 665
Comunicación via Correo: apic1002002 at yahoo dot es; apic1002002@gmail.com
User avatar
Armando Picon
 
Posts: 446
Joined: Mon Dec 26, 2005 9:11 pm
Location: Lima, Peru

Re: TDOSPRN y XP WINDOWS

Postby Kleyber » Sun Jan 23, 2011 2:12 am

Armando, una preguntita: Si intentas imprimir y no imprime nada en el momento del envio, y si luego despues quitas la aplicación? Te sale la impresión?
Kleyber Derick

FWH / xHb / xDevStudio / SQLLIB
User avatar
Kleyber
 
Posts: 581
Joined: Tue Oct 11, 2005 11:28 am
Location: São Luiz, Brasil

Re: TDOSPRN y XP WINDOWS

Postby Armando Picon » Sun Jan 23, 2011 5:15 am

Kleyber, gusto en volver a comunicarme contigo.

la bendita impresora no funca ni saliendo de la aplicación. Esta es una situación de lo más rara. Acabo de reinstalar una nueva versión de XP y voy a seguir probando. Lo curioso es que si utilizo el tPrinter funciona bien todo. La excepción es el caso del TDOSPRN que debo utilizarlo, si o sí.

Saludos

Armando
FWH + BCC582 + WorkShop 4.5 + Resource Hacker + Mingw
Mis nuevas herramientas
Comunicacion via WhatsApp (+51) 957549 665
Comunicación via Correo: apic1002002 at yahoo dot es; apic1002002@gmail.com
User avatar
Armando Picon
 
Posts: 446
Joined: Mon Dec 26, 2005 9:11 pm
Location: Lima, Peru

Re: TDOSPRN y XP WINDOWS

Postby Kleyber » Sun Jan 23, 2011 6:14 pm

Armando,

Un gusto hablar contigo. No tengo ni idea de lo que este pasando con estes equipos, pero en mi caso tuve problemas en algunos clientes porque las impresoras usaban USB, entonces hice una rutina que funciona en ambos los casos, usando TDosprn. Te muestro:

Enla cabecera de mi rutina de impresión hice esto:
Code: Select all  Expand view

cPorta := PrnGetPort()
cPrinter := PrinterPortToName( cPorta )
if empty(cPrinter)
   cPrinter := PrinterPortToName( "USB002" )
   if empty(cPrinter)
      cPrinter := PrinterPortToName( "USB001" )
   endif
endif
 


Despues empiezo la impresión, preo creando un archivo:
Code: Select all  Expand view

oPrin := TDosPrn():New("minuta.txt")
oPrin:StartPage()
...
...
 



Y en el fin de la rutina hago esto:
Code: Select all  Expand view

...
...
oPrin:EndPage()
oPrin:End()


PrintFileRaw( cPrinter, TrueName("MINUTA.TXT"), "Impressão de Vendas" )
 


Intentalo y me comentas.
Kleyber Derick

FWH / xHb / xDevStudio / SQLLIB
User avatar
Kleyber
 
Posts: 581
Joined: Tue Oct 11, 2005 11:28 am
Location: São Luiz, Brasil

Re: TDOSPRN y XP WINDOWS

Postby Armando Picon » Sun Jan 23, 2011 7:24 pm

Kleyber, muchas gracias.

Como siempre, tan desprendido en tus conocimientos. Voy a modificar la rutina de impresión con tus aportes y ver qué resulta. Si no hubiera éxito, te lo comento.

Saludos

Armando
FWH + BCC582 + WorkShop 4.5 + Resource Hacker + Mingw
Mis nuevas herramientas
Comunicacion via WhatsApp (+51) 957549 665
Comunicación via Correo: apic1002002 at yahoo dot es; apic1002002@gmail.com
User avatar
Armando Picon
 
Posts: 446
Joined: Mon Dec 26, 2005 9:11 pm
Location: Lima, Peru

Re: TDOSPRN y XP WINDOWS

Postby artu01 » Mon Jan 24, 2011 8:20 pm

Saludos Kleyber
la function TrueName(... no la tengo dentro de mi clase tdosprn

Podrias enviarme el tdosprn modiicado por ti
artu01
 
Posts: 397
Joined: Fri May 11, 2007 8:20 pm
Location: Lima

Re: TDOSPRN y XP WINDOWS

Postby Armando Picon » Mon Jan 24, 2011 8:36 pm

Truename() forma parte de xHarbour:

TrueName()
Completes a relative path to include the root directory.
Syntax
TrueName( <cPath> ) --> cRoot

Arguments
<cPath>
A character string holding a valid path specification like "." or "..\..\". Return
The function returns a character string containing a full path name beginning from the root directory. If <cPath> is invalid, the return value is a null string ("").

Saludos

Armando
FWH + BCC582 + WorkShop 4.5 + Resource Hacker + Mingw
Mis nuevas herramientas
Comunicacion via WhatsApp (+51) 957549 665
Comunicación via Correo: apic1002002 at yahoo dot es; apic1002002@gmail.com
User avatar
Armando Picon
 
Posts: 446
Joined: Mon Dec 26, 2005 9:11 pm
Location: Lima, Peru

Re: TDOSPRN y XP WINDOWS - SOLUCIONADO

Postby Armando Picon » Mon Jan 24, 2011 8:50 pm

Kleyber, gracias por tu aporte.

Solucione el caso de tdosprn. No tuve que utilizar el trozo de codigo que me indicaste pero cuando afronte el caso de las impresoras conectadas a USB ya tengo la solución en tu aporte.

El codigo que me solucionó el problema es un tdosprn modificado y funciona muy bien en XP-SP2. Voy a probarlo en XP-SP3 y otros. Este es el que utilicé.

/*
ÚÄ Programa ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
³ Aplication: Class TDosPrint ³
³ File: TDOSPRN.PRG ³
³ Author: Ignacio Ortiz de Z£¤iga Echeverr¡a ³
³ CIS: Ignacio Ortiz (Ignacio_Ortiz) ³
³ Internet: http://www.ozs.com ³
³ Date: 09/13/96 ³
³ Time: 20:20:07 ³
³ Copyright: 1997 by Ortiz de Zu¤iga, S.L. ³
ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ

NOTES:

The following code will let you print directly to the printer from inside
any Fivewin program, like OLD DOS days. Those users that need DOS printing
speed can use this class instead of the TPrinter class.

This is a little sample of how to use the new class:

LOCAL oPrn

oPrn := TDosPrn():New("lpt1")

oPrn:StartPage() // optional
oPrn:Say(10,20, "This goes in line 10, column 20")
oPrn:EndPage() // optional

oPrn:End()

A little description of all the members of this class:

DATA:

cPort: Printing port, by default "LPT1"
cCompress: String for compressed mode, by default "15"
cNormal: String for normal mode, by default "18"
cFormFeed: String for EJECT, by default "12"
hDC: Printing file Handle (Internal use)
nRow: Current printing row
nCol: Current pringing column
nLeftMargin: Left margin, by default 0
nTopMargin: Top margin, by default 0
lAnsiToOem: If .T. a Ansi to Oem translation is done automatically
whe printing, by default is .T.

lScreen

METHODS:

New(cPort) Constructor, no comment
End() Destructor, no comment
StartPage() Begining of a page, this method is optional
EndPage() End of page, this method is optional if there is only on page
Command(c) Let you send any command to the printer without changing the
current row and col. The string to pass as a parameter should
content the ascii values of the command separated with commas,
for example, the command to reset Epson printers should
be: "27,69"
SetCoors(r,c) Let you change the current row and col is the equivalent of
SetPrc() of Ca-Clipper
NewLine() Increments the current row
Write(cText) Prints the string cText in the current row and column
Say(nRow ,; Prints the string cText in nRow, nCol
nCol ,; lAtoO indicates if the string should be transformed to Oem,
cText ,; by default is ::lAnsiToOem
lAtoO )
SayCmp() The same as the method Say but prints in compressed mode and
the row is updated accordly.

NOTE:

If you try to print on a row before the current one a EJECT will be
done automatically.

In the same way if you try to print on the same row as the current, but
in a previous column from the current one a EJECT will be done automatically

At the end of this class is a little function call WorkSheet that will make
the job of DOS printing a lot easier.

Enjoy it!
*/

#include "fivewin.ch"
#include "fileio.ch"

#translate nTrim(<n>) => AllTrim(Str(<n>,10,0))

#define PF_BUFLEN 2048

//----------------------------------------------------------------------------//

CLASS TDosPrn

DATA LastError
DATA cPort, cCompress, cNormal, cFormFeed, cBuffer
DATA cInitPrn //RDC
DATA cNegOn //RDC
DATA cNegOff //RDC
DATA cItaOn //RDC
DATA cItaOff //RDC
DATA cEmpOn //RDC
DATA cEmpOff //RDC
DATA c10Cpi //RDC
DATA c12Cpi //RDC
DATA cWidOn //RDC
DATA cWidOff //RDC
DATA hDC, nRow, nCol, nLeftMargin, nTopMargin AS NUMERIC
DATA lAnsiToOem AS LOGICAL
DATA oWnd, oPagina // Ednaldo
DATA nPage AS NUMERIC // Ednaldo
DATA cDevice // Ralph
DATA nMaxLine, nLength, nLastError AS NUMERIC // Ralph
DATA lCancel, lPreview, lModograf, lIsLaser AS LOGICAL // Ralph

METHOD New(cPort) CONSTRUCTOR

METHOD End()

METHOD StartPage() INLINE ::ShowProc() // Ednaldo

METHOD EndPage()

METHOD Command(xPar1, xPar2, xPar3, xPar4, xPar5)

METHOD SetCoors(nRow, nCol)

METHOD NewLine() INLINE (::cBuffer += CRLF ,;
::nRow++ ,;
::nCol := 0 )

METHOD Write(cText, lAToO) ;
INLINE (iif(lAtoO == NIL, lAtoO := .T.,),;
::cBuffer += iif(lAtoO, AnsitoOem(cText), cText) ,;
::nCol += len(cText) )

METHOD Say(nRow, nCol, cText, lAToO)

METHOD SayCmp(nRow, nCol, cText)

METHOD PrintFile(cFile)

METHOD ShowProc() // Ednaldo

METHOD PrintSetup() // Ralph

ENDCLASS

//----------------------------------------------------------------------------//

METHOD New() CLASS TDosPrn

::cCompress := "15"
::cNormal := "18"
::cFormFeed := "12"
::cInitPrn := "18,27,80"
::cNegOn := "27,71"
::cNegOff := "27,72"
::c10cpi := "27,80"
::c12cpi := "27,77"
::cWidOn := "27,87,1"
::cWidOff := "27,87,0"
::cEltCmp := "27,33,5"
::cBuffer := ""
::nLeftMargin := 0
::nTopMargin := 0
::nRow := 0
::nCol := 0
::lAnsiToOem := .T.
::cPort := StrTran( PrnGetPort(), ":", "" )
::nLastError := fError()
if ::nLastError <> 0
MsgInfo('No hay impresora activa')
endif
::cDevice := ::cPort+iif(!"."$::cPort,".PRN","")
::hDC := fCreate(::cPort)
*::lPreview := .t. // Original - Se visualiza previamente
::lPreview := .F. // APS- No se visualiza NADA previamente
::lCancel := .f.
::nMaxLine := 66
::nLength := 66
::lModoGraf := .f.
::lIsLaser := .f.

::nPage := 1 // Ednaldo
::PrintSetup() //Ralph

RETURN Self

//----------------------------------------------------------------------------//

METHOD End() CLASS TDosPrn

IF !empty(::nRow+::nCol)
::EndPage()
ENDIF

::LastError := 0

IF !fClose(::hDC)
::LastError := fError()
ENDIF

CursorArrow()

if ::oWnd != Nil // Ednaldo
::oWnd:End() // Ednaldo
endif // Ednaldo

RETURN NIL

//----------------------------------------------------------------------------//

METHOD EndPage() CLASS TDosPrn

LOCAL nFor, nLen, nSec
LOCAL lError

::Command(::cFormFeed)

::LastError := 0

IF fWrite(::hDC, ::cBuffer) < len(::cBuffer)
::LastError := fError()
ENDIF

::cBuffer := ""
::nRow := 0
::nCol := 0

RETURN NIL

//----------------------------------------------------------------------------//

METHOD Command(xPar1, xPar2, xPar3, xPar4, xPar5) CLASS TDosPrn

LOCAL cCommand, cToken, cString
LOCAL nToken

cString := cValToChar(xPar1)

IF xPar2 != NIL
cString += ","+cValToChar(xPar2)
ENDIF

IF xPar3 != NIL
cString += ","+cValToChar(xPar3)
ENDIF

IF xPar4 != NIL
cString += ","+cValToChar(xPar4)
ENDIF

IF xPar5 != NIL
cString += ","+cValToChar(xPar5)
ENDIF

cCommand := ""
nToken := 1

DO WHILE !Empty(cToken := StrToken(cString, nToken++, ","))
cCommand += Chr(Val(cToken))
ENDDO

::cBuffer += cCommand

RETURN NIL

//----------------------------------------------------------------------------//

METHOD SetCoors(nRow, nCol) CLASS TDosPrn

nRow += ::nTopMargin
nCol += ::nLeftMargin

IF ::nRow > nRow
::EndPage()
::nPage++ // Ednaldo
::StartPage()
ENDIF

IF nRow == ::nRow .AND. nCol < ::nCol
::EndPage()
::nPage++ // Ednaldo
::StartPage()
ENDIF

DO WHILE ::nRow < nRow
::NewLine()
ENDDO

IF nCol > ::nCol
::Write(Space(nCol-::nCol))
ENDIF

RETURN NIL

//----------------------------------------------------------------------------//

METHOD Say(nRow, nCol, cText, lAToO) CLASS TDosPrn

DEFAULT lAToO := ::lAnsiToOem

IF VALTYPE( cText ) = "D"
cText := DTOC( cText )
ENDIF

IF VALTYPE( cText ) = "N"
cText := STR( cText )
ENDIF

::SetCoors(nRow, nCol)
::Write(cText, lAToO)

RETURN NIL

//----------------------------------------------------------------------------//

METHOD SayCmp(nRow, nCol, cText, lAToO) CLASS TDosPrn

DEFAULT lAToO := ::lAnsiToOem

::SetCoors(nRow, nCol)
::Command(::cCompress)
::cBuffer += iif(lAToO, AnsitoOem(cText), cText)
::nCol += Int(len(cText)/1.7+.5)
::Command(::cNormal)

RETURN NIL

//----------------------------------------------------------------------------//

METHOD PrintFile(cFile) CLASS TDosPrn

LOCAL hFile
LOCAL nRead
LOCAL cBuffer

hFile := FOpen(cFile, FO_READ)

IF hFile < 0
RETURN .F.
ENDIF

cBuffer := Space(PF_BUFLEN)

DO
nRead := fRead(hFile, @cBuffer, PF_BUFLEN)

IF fWrite(::hDC, Left(cBuffer, nRead)) < nRead
::LastError := fError()
fClose(hFile)
RETURN .F.
ENDIF
UNTIL nRead == PF_BUFLEN

fClose(hFile)

RETURN .T.

//----------------------------------------------------------------------------//
// Visualiza Processo de impressao // Ednaldo
//----------------------------------------------------------------------------//
METHOD ShowProc() CLASS TDosPrn

IF ::oWnd = Nil

DEFINE DIALOG ::oWnd TITLE "Imprimiendo ..." ;
FROM 230, 217 TO 360, 575 PIXEL

@ 10, 08 TO 40, 172 OF ::oWnd PIXEL

@ 1.4, 2 ICON NAME "PRINT.ICO" OF ::oWnd

@ 25, 45 SAY "Imprimiendo Página:" PIXEL OF ::oWnd SIZE 65, 12 RIGHT
@ 25, 115 SAY ::oPagina VAR ::nPage PIXEL OF ::oWnd UPDATE SIZE 20, 12 RIGHT

@ 47, 60 BUTTON "Aguarde..." SIZE 60, 12 PIXEL OF ::oWnd ACTION .t.

::oWnd:bPainted := {|| iif(::nPage>0, ::oPagina:Refresh(), )}

ACTIVATE DIALOG ::oWnd CENTER NOWAIT

CursorWait()
SysRefresh()

ELSE
::oWnd:BeginPaint()
::oWnd:Paint()
::oWnd:EndPaint()

ENDIF

RETURN NIL

//----------------------------------------------------------------------------//

FUNCTION WorkSheet(cPort)

LOCAL oPrn
LOCAL cLine
LOCAL nFor

cLine := ""

FOR nFor := 0 TO 7
cLine += Str(nFor,1)+Replicate(".",9)
NEXT

cLine := Substr(cLine,3)

oPrn := TDosPrn():New(cPort)

oPrn:StartPage()

FOR nFor := 0 TO 65
oPrn:Say(nFor,0,StrZero(nFor,2)+cLine)
NEXT

oPrn:EndPage()

oPrn:End()

RETURN NIL

//----------------------------------------------------------------------------//
// Parametros de impresion por el usuario // Ralph
//----------------------------------------------------------------------------//
METHOD PrintSetup() CLASS TDosPrn
local oDlg, oRad, oChk, oSay := array(3)
local nModo := 1
local nLinP := ::nLength, lPreview := .f.
local nTipo, oP := self
local oBtnOk, oBtnCn, oBtnSetup, oBtnAtrib, cModoImp

::lCancel := .t.

// cerramos el puerto que se abrio al principio
if (::hDC # -1) .and. ! fClose(::hDC)
::nLastError := fError()
endif
cOutPort := ::cPort
cPrnName := PrnGetName()
lPreview := ::lPreview
nModo := iif (::lModoGraf, 2, 1)
nLinP := ::nLength

DEFINE DIALOG oDlg TITLE "Impresion" ;
FROM 129, 178 TO 320, 635 PIXEL OF ::oWnd

@ 06, 08 TO 75, 220 OF oDlg PIXEL PROMPT "Impresora:"
@ 15, 15 SAY "Nombre :" PIXEL OF oDlg SIZE 30, 8
@ 24, 15 SAY "Tipo :" PIXEL OF oDlg SIZE 30, 8
@ 33, 15 SAY "Puerto :" PIXEL OF oDlg SIZE 30, 8
@ 42, 15 SAY "Lineas por pagina :" PIXEL OF oDlg SIZE 50, 8
@ 52, 15 SAY "Modo impresion " PIXEL OF oDlg SIZE 40, 8
@ 15,200 BUTTON "?" SIZE 10,10 PIXEL OF oDlg ;
ACTION (PrinterSetup(),;
oSay[1]:Settext(PrnGetName()), ;
oSay[2]:Settext(PrnGetDrive()),;
cOutPort := PrnGetPort() ,;
oSay[3]:Settext(cOutPort),;
oSay[1]:refresh(),oSay[2]:refresh(),;
oSay[3]:refresh(), sysrefresh())

@ 15, 50 SAY oSay[1] PROMPT PrnGetName() PIXEL OF oDlg SIZE 150, 8
@ 24, 50 SAY oSay[2] PROMPT PrnGetDrive() PIXEL OF oDlg SIZE 150, 8
@ 33, 50 SAY oSay[3] PROMPT cOutPort PIXEL OF oDlg SIZE 150, 8
@ 42,100 GET nLinP SIZE 20, 11 PIXEL OF oDlg UPDATE ;
VALID nLinP > 0 .and. nLinP <= 140 PICTURE "999"
@ 52, 60 RADIO oRad VAR nModo ;
ITEMS "&Texto (matricial)", "&Grafico (Laser)" SIZE 60, 10 PIXEL OF oDlg
*@ 52,150 CHECKBOX oChk VAR lPreview PROMPT "Previsualizar" SIZE 40, 10 PIXEL OF oDlg // APS - inactivo para que no haya intentos de usar preview

@ 80,115 BUTTON "&Ok" SIZE 50,11 PIXEL OF oDlg ;
ACTION ( ::lCancel := .f., oDlg:End() )

@ 80, 170 BUTTON "&Cancelar" SIZE 50,11 PIXEL OF oDlg ;
ACTION ( ::lCancel := .t., oDlg:End() ) CANCEL

ACTIVATE DIALOG oDlg CENTERED

if ! ::lCancel
::lModoGraf := ( nModo = 2 )
::lPreview := lPreview
::nLength := nLinP
::nMaxLine := ::nLength

if ::lIsLaser
::cCompress := "27,40,115,49,56,72"
::cNormal := "27,40,115,49,50,72"
if ::nWidth > 132
::cCompress := "27,40,115,50,50,72"
endif
else
::cCompress := "15"
::cNormal := "18"
endif

if ::lPreview
::cPort := cOutPort
::cDevice := Upper( cTempFile() )
else
::cPort := StrTran( cOutPort, ":", "" )
::cDevice := trim(::cPort)
endif

if ( ::hDC := fCreate(::cDevice) ) < 0
::lCancel := .t.
::nLastError := fError()
MsgInfo( "Error [" + str(::nLastError) + "] : Impresion Cancelada "+;
"No se pudo crear "+ ::cDevice, "Error" )
endif

endif

return nil
FWH + BCC582 + WorkShop 4.5 + Resource Hacker + Mingw
Mis nuevas herramientas
Comunicacion via WhatsApp (+51) 957549 665
Comunicación via Correo: apic1002002 at yahoo dot es; apic1002002@gmail.com
User avatar
Armando Picon
 
Posts: 446
Joined: Mon Dec 26, 2005 9:11 pm
Location: Lima, Peru

Re: TDOSPRN y XP WINDOWS

Postby Kleyber » Tue Jan 25, 2011 1:01 am

Armando,

Bien! Es un placer ayudar.

Saludos,
Kleyber Derick

FWH / xHb / xDevStudio / SQLLIB
User avatar
Kleyber
 
Posts: 581
Joined: Tue Oct 11, 2005 11:28 am
Location: São Luiz, Brasil

Next

Return to FiveWin para Harbour/xHarbour

Who is online

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