DLL32 FW24 vs FW916

DLL32 FW24 vs FW916

Postby hectorpapiri » Tue Nov 21, 2017 7: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
hectorpapiri
 
Posts: 23
Joined: Wed Sep 14, 2016 7:13 pm
Location: Rosario, Santa Fe, Argentina

Re: DLL32 FW24 vs FW916

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

Re: DLL32 FW24 vs FW916

Postby hectorpapiri » Wed Nov 22, 2017 3:55 pm

xHarbour 1.2.3 y BCC 7
Y el FW es el 16.10
hectorpapiri
 
Posts: 23
Joined: Wed Sep 14, 2016 7:13 pm
Location: Rosario, Santa Fe, Argentina

Re: DLL32 FW24 vs FW916

Postby karinha » Wed Nov 22, 2017 4:16 pm

https://ar.groups.yahoo.com/neo/groups/Fivewin-esp/conversations/topics/4777



Code: Select all  Expand view  RUN

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

Re: DLL32 FW24 vs FW916

Postby hectorpapiri » Wed Nov 22, 2017 4: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.
hectorpapiri
 
Posts: 23
Joined: Wed Sep 14, 2016 7:13 pm
Location: Rosario, Santa Fe, Argentina

Re: DLL32 FW24 vs FW916

Postby karinha » Wed Nov 22, 2017 6: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
User avatar
karinha
 
Posts: 7872
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: DLL32 FW24 vs FW916

Postby hectorpapiri » Wed Nov 22, 2017 6: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.
hectorpapiri
 
Posts: 23
Joined: Wed Sep 14, 2016 7:13 pm
Location: Rosario, Santa Fe, Argentina

Re: DLL32 FW24 vs FW916

Postby karinha » Wed Nov 22, 2017 6:27 pm

Mira se estais usando las LIBS correctas:

Code: Select all  Expand view  RUN

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

Re: DLL32 FW24 vs FW916

Postby karinha » Wed Nov 22, 2017 6:30 pm

Mira los SET de compilacion:

Code: Select all  Expand view  RUN

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

Re: DLL32 FW24 vs FW916

Postby hectorpapiri » Wed Nov 22, 2017 8:43 pm

karinha wrote:Mira los SET de compilacion:

Code: Select all  Expand view  RUN

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

Re: DLL32 FW24 vs FW916

Postby Antonio Linares » Thu Nov 23, 2017 6:47 am

Hector,

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

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42203
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: DLL32 FW24 vs FW916

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

Re: DLL32 FW24 vs FW916

Postby Antonio Linares » Fri Nov 24, 2017 3: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
User avatar
Antonio Linares
Site Admin
 
Posts: 42203
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: DLL32 FW24 vs FW916

Postby karinha » Fri Nov 24, 2017 5: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: Select all  Expand view  RUN

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

Re: DLL32 FW24 vs FW916

Postby hectorpapiri » Fri Nov 24, 2017 5: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"
hectorpapiri
 
Posts: 23
Joined: Wed Sep 14, 2016 7:13 pm
Location: Rosario, Santa Fe, Argentina

Next

Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 105 guests