FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour DLL32 FW24 vs FW916
Posts: 23
Joined: Wed Sep 14, 2016 07:13 PM
DLL32 FW24 vs FW916
Posted: Tue Nov 21, 2017 07:03 PM

Estimados,

Estamos haciendo una llamanda a "winfis32.dll" que es para el manejo de impresoras fiscales hasar (argentina), que con FW24 funciona perfecto, pero la misma DLL ejecutada con el programa compilado con FW916 devuelve otros valores en las funciones.

// Listado de funciones de WinFis32.dll
DLL32 FUNCTION OpenComFiscal( nCom AS _INT, nMode AS _INT ) AS _INT PASCAL LIB "winfis32.dll"
DLL32 FUNCTION MandaPaqueteFiscal( nHandler AS _INT, cBuffer AS LPSTR ) AS _INT PASCAL LIB "winfis32.dll"
DLL32 FUNCTION UltimaRespuesta( nHandler AS _INT, cBuffer AS LPSTR ) AS _INT PASCAL LIB "winfis32.dll"
DLL32 FUNCTION CloseComFiscal( nHandler AS _INT ) AS VOID PASCAL LIB "winfis32.dll"
DLL32 FUNCTION ReOpenComFiscal( nCom AS _INT ) AS _INT PASCAL LIB "winfis32.dll"
DLL32 FUNCTION InitFiscal( nHandler AS _INT ) AS _INT PASCAL LIB "winfis32.dll"
DLL32 FUNCTION VersionDLLFiscal( ) AS _INT PASCAL LIB "winfis32.dll"
DLL32 FUNCTION BusyWaitingMode( nMode AS _INT ) AS VOID PASCAL LIB "winfis32.dll"
DLL32 FUNCTION CambiarVelocidad( nPortNumber AS _INT, nNewSpeed AS LONG) AS VOID PASCAL LIB "winfis32.dll"
DLL32 FUNCTION SearchPrn( nHandler AS _INT ) AS LONG PASCAL LIB "winfis32.dll"
DLL32 FUNCTION ProtocolMode( nMode AS _INT ) AS _INT PASCAL LIB "winfis32.dll"
DLL32 FUNCTION SetCommandRetries( nRetries AS _INT ) AS _INT PASCAL LIB "winfis32.dll"
DLL32 FUNCTION Abort( nPortNumber AS _INT ) AS VOID PASCAL LIB "winfis32.dll

Si bien la llamada a la apertura del COM devuelve el mismo valor, o sea el handle, en los dos programas, al hacer las llamadas a las demas funciones con ese handle, nos devuelve valores distintos. Por ejemplo con SearchPrn() que tiene que devolver la velocidad del puerto y en FW24 devuelve 9600 y el 916 devuelve -1.

La verdad es que no sabemos por donde atacar este problema ya que al tratarse de una llamada a las funciones de una DLL no hay mucho o nada que cambiar entre dos versiones de FW.

Saludos
Héctor

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: DLL32 FW24 vs FW916
Posted: Wed Nov 22, 2017 11:55 AM

Hector,

Estas usando Clipper ó Harbour ?

Envíame un email a alinares@fivetechsoft.com y lo hablamos

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 23
Joined: Wed Sep 14, 2016 07:13 PM
Re: DLL32 FW24 vs FW916
Posted: Wed Nov 22, 2017 03:55 PM

xHarbour 1.2.3 y BCC 7
Y el FW es el 16.10

Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: DLL32 FW24 vs FW916
Posted: Wed Nov 22, 2017 04:16 PM
https://ar.groups.yahoo.com/neo/groups/Fivewin-esp/conversations/topics/4777



Code (fw): Select all Collapse
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function MandaPaq( nHandle, cBuffer ) // Debe llamar a 
MandaPaqueteFiscal()
// cBuffer pasa por referencia
return MandaPaqueteFiscal( nHandle, @cBuffer )

function Respuesta( nHandle ) // Debe llamar a UltimaRespuesta()
local cBuffer := space( 512 )
UltimaRespuesta( nHandle, @cBuffer )
return cBuffer

function OpenPort( nCom ) // Debe llamar a OpenComFiscal() y 
tambien a ReOpenComFiscal()
return OpenComFiscal( nCom, 0 ) // 0 = ASCII mode, 1 = ANSI mode.

function SearchPr( nHandler ) // Debe llamar a SerachPrn()
return SearchPrn( nHandler )

//function InitFiscal( nHandler ) // Debe llamara a InitFiscal()
//return InitFiscal( nHandler )

procedure ClosePort( nHandler ) // Debe llamar a CloseComFiscal()
CloseComFiscal( nHandler )
return

DLL32 FUNCTION OpenComFiscal ( nCom AS _INT, nMode AS _INT ) AS _INT 
PASCAL LIB "WINFIS32.DLL"
DLL32 FUNCTION MandaPaqueteFiscal ( nHandler AS _INT, cBuffer AS LPSTR ) 
AS _INT PASCAL LIB "WINFIS32.DLL"
DLL32 FUNCTION UltimaRespuesta ( nHandler AS _INT, cBuffer AS LPSTR ) 
AS _INT PASCAL LIB "WINFIS32.DLL"
DLL32 FUNCTION CloseComFiscal ( nHandler AS _INT ) AS VOID PASCAL LIB 
"WINFIS32.DLL"
DLL32 FUNCTION ReOpenComFiscal ( nCom AS _INT ) AS _INT PASCAL LIB 
"WINFIS32.DLL"
DLL32 FUNCTION InitFiscal ( nHandler AS _INT ) AS _INT PASCAL LIB 
"WINFIS32.DLL"
DLL32 FUNCTION VersionDLLFiscal ( ) AS _INT PASCAL LIB "WINFIS32.DLL"
DLL32 FUNCTION BusyWaitingMode ( nMode AS _INT ) AS VOID PASCAL LIB 
"WINFIS32.DLL"
DLL32 FUNCTION CambiarVelocidad ( nPortNumber AS _INT, nNewSpeed AS 
LONG) AS VOID PASCAL LIB "WINFIS32.DLL"
DLL32 FUNCTION SearchPrn ( nHandler AS _INT ) AS LONG PASCAL LIB 
"WINFIS32.DLL"
DLL32 FUNCTION ProtocolMode ( nMode AS _INT ) AS _INT PASCAL LIB 
"WINFIS32.DLL"
DLL32 FUNCTION SetCommandRetries ( nRetries AS _INT ) AS _INT PASCAL LIB 
"WINFIS32.DLL"
DLL32 FUNCTION Abort ( nPortNumber AS _INT ) AS VOID PASCAL LIB 
"WINFIS32.DLL"
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

By Walter Negro
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 23
Joined: Wed Sep 14, 2016 07:13 PM
Re: DLL32 FW24 vs FW916
Posted: Wed Nov 22, 2017 04:56 PM

Si Joao, es la misma rutina que utilizamos, la de Walter, pero con la actualización del año pasado no nos funciona, no se si es FW, xHarbour o BCC7.

Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: DLL32 FW24 vs FW916
Posted: Wed Nov 22, 2017 06:21 PM

FWH2.4 -> És 16 ó 32 bits? Se és 16 Bits, mira se no estais usando una classe de terceros incompatible con el FWH9.16.

FWH9.16 xHarbour, és el mismo que vién con la instalacíon que envió Antonio Liñares?

Saludos.

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 23
Joined: Wed Sep 14, 2016 07:13 PM
Re: DLL32 FW24 vs FW916
Posted: Wed Nov 22, 2017 06:23 PM
karinha wrote:FWH2.4 -> És 16 ó 32 bits? Se és 16 Bits, mira se no estais usando una classe de terceros incompatible con el FWH9.16.

FWH9.16 xHarbour, és el mismo que vién con la instalacíon que envió Antonio Liñares?

Saludos.


Es de 32b y es todo el paquete que envió Antonio.
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: DLL32 FW24 vs FW916
Posted: Wed Nov 22, 2017 06:27 PM
Mira se estais usando las LIBS correctas:

Code (fw): Select all Collapse
C:\FWH1612\lib\FiveHX.lib            +
C:\FWH1612\lib\FiveHC.lib            +
C:\XHB1612\lib\hbzip.Lib             +
C:\XHB1612\lib\zlib.Lib              +
C:\XHB1612\lib\rtl.Lib               +
C:\XHB1612\lib\vm.Lib                +
C:\XHB1612\lib\gtgui.Lib             +
C:\XHB1612\lib\lang.Lib              +
C:\XHB1612\lib\macro.Lib             +
C:\XHB1612\lib\rdd.Lib               +
C:\XHB1612\lib\dbfntx.Lib            +
C:\XHB1612\lib\dbfcdx.Lib            +
C:\XHB1612\lib\common.Lib            +
C:\XHB1612\lib\tip.Lib               +
C:\XHB1612\lib\pp.Lib                +
C:\XHB1612\lib\dbffpt.Lib            +
C:\XHB1612\lib\codepage.Lib          +
C:\XHB1612\lib\HbSix.Lib             +
C:\XHB1612\lib\PcRepos.Lib           +
C:\XHB1612\Lib\ct.Lib                +
C:\XHB1612\Lib\png.Lib               +
C:\BCC7\lib\cw32.Lib                 +
c:\BCC7\lib\uuid.lib                 +
c:\BCC7\lib\ws2_32.lib               +
C:\BCC7\lib\psdk\msimg32.Lib         +
C:\BCC7\lib\psdk\odbc32.Lib          +
C:\BCC7\lib\psdk\rasapi32.Lib        +
C:\BCC7\lib\psdk\nddeapi.Lib         +
C:\BCC7\lib\psdk\psapi.Lib           +
c:\BCC7\lib\psdk\gdiplus.lib         +
C:\BCC7\lib\psdk\iphlpapi.Lib        +
c:\BCC7\lib\psdk\shell32.lib         +
C:\BCC7\lib\import32.Lib


Saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: DLL32 FW24 vs FW916
Posted: Wed Nov 22, 2017 06:30 PM
Mira los SET de compilacion:

Code (fw): Select all Collapse
Set hdir=C:\XHB1612
Set bcdir=C:\bcc7
Set fwhdir=C:\FwH1612



Bién como, los *.CFG

Saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 23
Joined: Wed Sep 14, 2016 07:13 PM
Re: DLL32 FW24 vs FW916
Posted: Wed Nov 22, 2017 08:43 PM
karinha wrote:Mira los SET de compilacion:

Code (fw): Select all Collapse
Set hdir=C:\XHB1612
Set bcdir=C:\bcc7
Set fwhdir=C:\FwH1612



Bién como, los *.CFG

Saludos.


Gracias Joao, pero no es el caso.
Para evitar que sea por modificaciones propias, armamos un prg de prueba y lo compilamos con los buildx.bat de ambas versiones.
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: DLL32 FW24 vs FW916
Posted: Thu Nov 23, 2017 06:47 AM

Hector,

Prueba a cambiar todos los _INT por LONG y DLL32 por DLL

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 23
Joined: Wed Sep 14, 2016 07:13 PM
Re: DLL32 FW24 vs FW916
Posted: Thu Nov 23, 2017 12:44 PM
Antonio Linares wrote:Hector,

Prueba a cambiar todos los _INT por LONG y DLL32 por DLL


No Antonio, sigue respondiendo lo mismo.
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: DLL32 FW24 vs FW916
Posted: Fri Nov 24, 2017 03:28 PM

Hector,

Si me envias un sencillo PRG de prueba, lo construimos con FWH 17.09 y te lo envio para que lo pruebes

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: DLL32 FW24 vs FW916
Posted: Fri Nov 24, 2017 05:07 PM
manual en .pdf:

https://impresorasfiscalespanama.com/wp-content/uploads/2015/12/Manual-WINFIS32_DLL-v0427.pdf

Como usted llama la dll asi,

Code (fw): Select all Collapse
   nError := CallDll32 ( "InitFiscal", "WINFIS32.DLL", handler )

   If nError==0
      lRetorno:=.T.
   Else
      MsgInfo( Str( nError ) )
   EndIf


o con LoadLibrary()?

Saludos
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 23
Joined: Wed Sep 14, 2016 07:13 PM
Re: DLL32 FW24 vs FW916
Posted: Fri Nov 24, 2017 05:27 PM
Antonio Linares wrote:Hector,

Si me envias un sencillo PRG de prueba, lo construimos con FWH 17.09 y te lo envio para que lo pruebes


#include "fivewin.ch"
#include "dll.ch"

#xtranslate nTrim( <x> [,<y>] [,<z>] ) => AllTrim(Str( <x> [,<y>] [,<z>] ))

FUNCTION Test( nPort )
local nHandle, nRate, nInit

DEFAULT nPort := "3"
nPort := Val(nPort)

? "Port", nPort, VersionDLLFiscal()
nRate := 9600
nHandle := OpenPort( nPort )

? "Handle", nHandle
// CambiarVelocidad( nPort, 9600 )
nRate := SearchPr( nHandle )

? "Rate", nRate
if nRate == -1
? "Error de Comunicación con el Puerto COM" + nTrim(nPort), "Reinicie el Controlador Fiscal ..."
nHandle := NIL
else
ProtocolMode(1)

nInit := InitFiscal( nHandle )

? "Init", nInit
if nInit < 0
? "Error de Comunicación con el Puerto COM" + nTrim(nPort), "Reinicie el Controlador Fiscal ..."
nHandle := NIL
endif
endif

? "Close"
ClosePort( nHandle )

RETURN NIL

function OpenPort( nCom ) // Debe llamar a OpenComFiscal() y tambien a ReOpenComFiscal()
return OpenComFiscal( nCom, 0 ) // 0 = ASCII mode, 1 = ANSI mode.

function SearchPr( nHandler ) // Debe llamar a SerachPrn()
return SearchPrn( nHandler )

procedure ClosePort( nHandler ) // Debe llamar a CloseComFiscal()
CloseComFiscal( nHandler )
return


DLL32 FUNCTION OpenComFiscal( nCom AS _INT, nMode AS _INT ) AS _INT PASCAL FROM "OpenComFiscal" LIB "winfis32.dll"
DLL32 FUNCTION MandaPaqueteFiscal( nHandler AS _INT, cBuffer AS LPSTR ) AS _INT PASCAL FROM "MandaPaqueteFiscal" LIB "winfis32.dll"
DLL32 FUNCTION UltimaRespuesta( nHandler AS _INT, cBuffer AS LPSTR ) AS _INT PASCAL FROM "UltimaRespuesta" LIB "winfis32.dll"
DLL32 FUNCTION CloseComFiscal( nHandler AS _INT ) AS VOID PASCAL FROM "CloseComFiscal" LIB "winfis32.dll"
DLL32 FUNCTION ReOpenComFiscal( nCom AS _INT ) AS _INT PASCAL FROM "ReOpenComFiscal" LIB "winfis32.dll"
DLL32 FUNCTION InitFiscal( nHandler AS _INT ) AS _INT PASCAL FROM "InitFiscal" LIB "winfis32.dll"
DLL32 FUNCTION VersionDLLFiscal( ) AS _INT PASCAL FROM "VersionDLLFiscal" LIB "winfis32.dll"
DLL32 FUNCTION BusyWaitingMode( nMode AS _INT ) AS VOID PASCAL FROM "BusyWaitingMode" LIB "winfis32.dll"
DLL32 FUNCTION CambiarVelocidad( nPortNumber AS _INT, nNewSpeed AS LONG) AS VOID PASCAL FROM "CambiarVelocidad" LIB "winfis32.dll"
DLL32 FUNCTION SearchPrn( nHandler AS _INT ) AS LONG PASCAL FROM "SearchPrn" LIB "winfis32.dll"
DLL32 FUNCTION ProtocolMode( nMode AS _INT ) AS _INT PASCAL FROM "ProtocolMode" LIB "winfis32.dll"
DLL32 FUNCTION SetCommandRetries( nRetries AS _INT ) AS _INT PASCAL FROM "SetCommandRetries" LIB "winfis32.dll"
DLL32 FUNCTION Abort( nPortNumber AS _INT ) AS VOID PASCAL FROM "Abort" LIB "winfis32.dll"