DLL32 FW24 vs FW916

hectorpapiri
Posts: 23
Joined: Wed Sep 14, 2016 7:13 pm
Location: Rosario, Santa Fe, Argentina
Contact:

DLL32 FW24 vs FW916

Post by hectorpapiri »

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
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: DLL32 FW24 vs FW916

Post by Antonio Linares »

Hector,

Estas usando Clipper ó Harbour ?

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

Antonio Linares
www.fivetechsoft.com
hectorpapiri
Posts: 23
Joined: Wed Sep 14, 2016 7:13 pm
Location: Rosario, Santa Fe, Argentina
Contact:

Re: DLL32 FW24 vs FW916

Post by hectorpapiri »

xHarbour 1.2.3 y BCC 7
Y el FW es el 16.10
User avatar
karinha
Posts: 4882
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: DLL32 FW24 vs FW916

Post by karinha »

https://ar.groups.yahoo.com/neo/groups/ ... opics/4777


Code: Select all

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
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
hectorpapiri
Posts: 23
Joined: Wed Sep 14, 2016 7:13 pm
Location: Rosario, Santa Fe, Argentina
Contact:

Re: DLL32 FW24 vs FW916

Post by hectorpapiri »

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.
User avatar
karinha
Posts: 4882
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: DLL32 FW24 vs FW916

Post by karinha »

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
hectorpapiri
Posts: 23
Joined: Wed Sep 14, 2016 7:13 pm
Location: Rosario, Santa Fe, Argentina
Contact:

Re: DLL32 FW24 vs FW916

Post by hectorpapiri »

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.
User avatar
karinha
Posts: 4882
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: DLL32 FW24 vs FW916

Post by karinha »

Mira se estais usando las LIBS correctas:

Code: Select all

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
User avatar
karinha
Posts: 4882
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: DLL32 FW24 vs FW916

Post by karinha »

Mira los SET de compilacion:

Code: Select all

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
hectorpapiri
Posts: 23
Joined: Wed Sep 14, 2016 7:13 pm
Location: Rosario, Santa Fe, Argentina
Contact:

Re: DLL32 FW24 vs FW916

Post by hectorpapiri »

karinha wrote:Mira los SET de compilacion:

Code: Select all

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.
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: DLL32 FW24 vs FW916

Post by Antonio Linares »

Hector,

Prueba a cambiar todos los _INT por LONG y DLL32 por DLL
regards, saludos

Antonio Linares
www.fivetechsoft.com
hectorpapiri
Posts: 23
Joined: Wed Sep 14, 2016 7:13 pm
Location: Rosario, Santa Fe, Argentina
Contact:

Re: DLL32 FW24 vs FW916

Post by hectorpapiri »

Antonio Linares wrote:Hector,

Prueba a cambiar todos los _INT por LONG y DLL32 por DLL
No Antonio, sigue respondiendo lo mismo.
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: DLL32 FW24 vs FW916

Post by Antonio Linares »

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
User avatar
karinha
Posts: 4882
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: DLL32 FW24 vs FW916

Post by karinha »

manual en .pdf:

https://impresorasfiscalespanama.com/wp ... -v0427.pdf

Como usted llama la dll asi,

Code: Select all

   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
hectorpapiri
Posts: 23
Joined: Wed Sep 14, 2016 7:13 pm
Location: Rosario, Santa Fe, Argentina
Contact:

Re: DLL32 FW24 vs FW916

Post by hectorpapiri »

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"
Post Reply