Jump to content
Fivewin Brasil

SAT - TANCA


maudruidas

Recommended Posts

Boa tarde, sempre desenvolvi com os Sats da Bematech e agora estou com um Sat Tanca TS-1000 de um cliente. Estou tetando fazer um teste carregando a DLL deles porém a resposta vem sempre a mesma. Meu primeiro teste é usar a função ConsultarSAT(), passando o número da sessão. Ele sempre retorna número de sessão inválido. Acho que não estou sabendo lidar com a DLL. Vejam como estou fazendo, e se alguém poder me dar uma força agradeço. Lembrando que no programa InteliSAT da Tanca funciona normalmente.

Carregando a DLL

     XDLL := LoadLib32("C:\SISCOM20\SAT.dll")
 

Declarando a DLL

#include "FiveWin.ch"
#define _VIDEO_CH
#define _OBJECTS_CH
#define _DDE_CH

*************************
FUNCTION DECTANCA()  // Declaracoes da TANCA de 32 bits -> SAT.DLL

  // Consultar SAT
  DLL32 FUNCTION CONSAT(XRETS AS STRING ) AS LPSTR PASCAL  FROM "ConsultarSAT" LIB xDll
 

Chamando a Função

**********************
FUNCTION RSAT2()
  NRET := Space(70)
  SES  := 008567

  nRet := Consat(SES)

  MsgStop("Retorno: " + nret ,"Informações do SAT")
  RETURN(.T.)

 

Link to comment
Share on other sites

  • 2 weeks later...

eu uso assim e funciona muito bem, com qualquer sat:

 

hdllSAT:=LoadLibrary( "SAT.dll" )

 

N_SESSAO:=INT(NRANDOM(999999)+1)
 

retorno:= SATConsultar(N_SESSAO)

? retorno

 

return .t.

 

DLL32 Function SATConsultar(NumeroSessao AS _INT) AS STRING PASCAL FROM "ConsultarSAT" LIB hdllSAT
DLL32 Function CSO_sat(NumeroSessao AS _INT, codigoDeAtivacao AS STRING) AS STRING PASCAL FROM "ConsultarStatusOperacional" LIB hdllSAT
 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...