Jump to content
Fivewin Brasil

Bematech do Cão - Resolvido


jfaguiar

Recommended Posts

Ola meus amigos.

 

Instalei o programa Bematech Winmfd2 para gerar o arquivo da nota fiscal paulista, que funcionou perfeitamente, mas que sem explicaçãp fez o meu programa parar de detectar a porta serial, resultando em impressora fiscal não detectada.

Para maior clareza, estou em um micro com Windows XP e utiliso a função LodLib32() para carregar a dll bemafi32. Já desativei e ativei as portas seriais no gerenciador de dispositivo e nada.

 

Alguém pode me dizer o poderar esta acontecendo?

 

O brigado

Link to comment
Share on other sites

Ola, voce esta usando comando de FIVEWIN FOR CLIPPER e se esta em 32 bits:

 

use: LoadLibrary() conforme modelo abaixo

 


STATIC XDLL_BEMATECH  //-> DLL DA IMPRESSORA FISCAL BEMATECH     3
 
 
FUNCTION DECLARA_BEMA()
 
    IF XMODELOECF = "3".AND. VAL(XPORTADOECF) > 0
 
       IF !FILE( "BEMAFI32.DLL" )
          MsgAlert( "O Arquivo " + "BEMAFI32.DLL "     +        ;
                    "Não Foi Encontrado"               + CRLF + ;
                   "Entre em Contato Com o Suporte"   + CRLF + ;
                    "Pelos Fones: (11) 3106-2832 / 8243-5632",  ;
                    "Componente Ausente, Verifique!" )
          RETURN NIL
       ENDIF
 
       // Abre a DLL da Bematech
       xDll_BemaTech := LoadLibrary( "BEMAFI32.DLL" )
 
       CURSORWAIT() //-> verifica se a impressora esta ligada
 
       m->Int_Retorno := BmPrintLig()
 
       IF m->Int_Retorno = 1
          //-> Impressora Ligada, Nada a Fazer
       ELSE
          MsgInfo( OemToAnsi( "Impressora BEMATECH Desligada, Verifique!" ), ;
                   OemToAnsi( "Impressora BEMATECH Desligada, Verifique!" ) )
 
          CURSORARROW()
          DBCLOSEALL()  //-ÿ ligar depois
          RETURN NIL
       ENDIF
 
    ENDIF
 
RETURN NIL
 
//-> FECHA AS DLLS DAS IMPRESSORAS FISCAIS
 
FUNCTION FECHA_DLLS_FISCAIS()
 
    PUBLIC XMODELOECF, XPORTADOECF
 
    IF VAL( XMODELOECF ) > 0 .AND. VAL( XPORTADOECF ) > 0
 
       IF XMODELOECF = "1"
          //-> Pau com  a DLL da Borland desliguei
          FreeLibrary( XDLL_DARUMA )
       ENDIF
 
       IF XMODELOECF = "2"
          FreeLibrary( XDLL_SWEDA )
       ENDIF
 
       IF XMODELOECF = "3"
          FreeLibrary( XDLL_BEMATECH )
       ENDIF
 
       //-> 4  nao declarada ainda DATA REGIS
       IF XMODELOECF="4"
          FreeLibrary( XDLL_DATAREGIS )
       ENDIF
 
       //-> 5  nao declarada ainda QUATTRO
       IF XMODELOECF="5"
          FreeLibrary( XDLL_QUATTRO )
       ENDIF
 
       IF XMODELOECF="6"
          FreeLibrary( XDLL_AFRAC )
       ENDIF
 
       //-> 7 Elgin, nao declarada
       IF XMODELOECF = "7"
          FreeLibrary( XDLL_ELGIN )
       ENDIF
 
       IF XMODELOECF = "8"
          FreeLibrary( XDLL_EPSON )
       ENDIF
 
    ENDIF
 
RETURN NIL


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...