Jump to content
Fivewin Brasil

emotta

Membros
  • Posts

    1,609
  • Joined

  • Last visited

  • Days Won

    88

Posts posted by emotta

  1. Eu resolveria da seguinte maneira:

     

    - crie um bucket no aws S3 

    - na matriz tenha uma opção para enviar o cadastro para web. Essa opção gera um arquivo texto no formato json com todos os campos do seu cadastro de produtos.

    - nas filiais basta vc ler o arquivo que estará disponível na web no bucket S3

     

    Aqui nesse vídeo tem tudo que vc precisa pra aprender a subir arquivo no seu bucket S3.

     

     

    Obs: se este seu cliente, que é uma rede de lanchonetes, precisar de uma solução de ponto eletrônico me procure. 

    Abraços e boa sorte 

     

     

     

     

     

  2. 5 horas atrás, Ladinilson disse:

    Bom dia senhores,

    Fiz uma rotina de auditoria para meus sistemas para gravar todas as ações dos usuários no programa (e isso já rendeu alguns dividendos aos donos de empresas rsrs) pois nela tens como comprovar e contradizer alguns funcionários que acham que não estão sendo monitorados.

    Durante minha vida já vi de tudo o que os funcionários são capazes de fazer em um empresa como o responsável pelas entregas e notas para embarque para o dia seguinte que trocava as datas para o caixa então o patrão não via o dinheiro cair e seu estoque só diminuia. Entendi que aquilo era uma GRANDE FALHA do meu sistema mas fica a lição de que os caras se encontrarem uma brecha, vão fazer, coisa de brasileiro né?

    E também uma outra maneira é a proteção dos seus DBFs com uma simples rotina que todos do forum conhecem....

    
    PROTEGE(.f.,<nomeDBF.DBF>) // .T. PROTEGE E .F. LIBERA
      
    FUNCTION PROTEGE(lProtec, cFile)
    LOCAL nHandle := 0, cBuffer := space(32)
    nHandle := FOPEN(cFile, FO_READWRITE + FO_SHARED)
    IF nHandle # -1
       IF FRead(nHandle, @cBuffer, 32) == 32
          IF lProtec    // Protege
             IF substr( cBuffer, 1, 1 ) # chr(26)
                cBuffer := chr(26) + substr( cBuffer, 1, 31)
             ENDIF
          ELSE                // Desprotege
             IF substr(cBuffer, 1, 1) == chr(26)
               cBuffer := substr( cBuffer, 2, 31 ) + Chr( 0 )
             ENDIF
          ENDIF
          FSEEK( nHandle, 0 )
          FWRITE( nHandle, cBuffer, 32 )
       ENDIF
       FCLOSE( nHandle )
    ENDIF
    RETURN( FError() )

    Entendemos agora meu caro mas acho que a solução de "catar" o que o meliante digita não seria a correta pois na mesma levada, estaria expondo TODOS da empresa e certamente o dono vai querer isso para outros fins, se é que tu me entendes.
    Abs
     

    Pelo que entendi o a desconfiança do Andre é que estão alterando direto no DBF, aí não tem jeito.

    Minha recomendação é usar um banco de dados (sql server express, mysql, etc) pois aí o cara tem que saber a senha pra alterar algo direto na fonte. Se isso for possivel é o que recomendo.

  3. 5 horas atrás, kapiaba disse:

    Bom dia. Em windows de 32 bits, deus estouro de pilha. Eduardo pode explicar o que ele faz ou faria se funcionasse?

    Assinatura do problema:
      Nome do Evento de Problema:    APPCRASH
      Nome do Aplicativo:    nes.exe
      Versão do Aplicativo:    0.0.0.0
      Carimbo de Data/Hora do Aplicativo:    60df2360
      Nome do Módulo de Falhas:    nes.exe
      Versão do Módulo de Falhas:    0.0.0.0
      Carimbo de Data/Hora do Módulo de Falhas:    60df2360
      Código de Exceção:    c0000005
      Deslocamento de Exceção:    00064ad0
      Versão do sistema operacional:    6.1.7601.2.1.0.256.48
      Identificação da Localidade:    1046
      Informações Adicionais 1:    b6d1
      Informações Adicionais 2:    b6d1da32975aceebf4393e4640a639be
      Informações Adicionais 3:    9aca
      Informações Adicionais 4:    9acae621b1232f52aa415d64157afee4

    Leia nossa declaração de privacidade online:
      http://go.microsoft.com/fwlink/?linkid=104288&clcid=0x0416

    Se a declaração de privacidade online não estiver disponível, leia nossa declaração de privacidade offline:
      C:\Windows\system32\pt-BR\erofflps.txt
     

    Regards, saludos.

     

    Kapiaba, o pai da criança é o Wagner, acredito que ele seja o melhor para lhe dizer (caso a documentação que está no github não seja suficiente)

  4. 4 minutos atrás, wanderso disse:

    Então tenho sim, e não é criado nenhum bmp dentro dela, e já tentei também utilizando cFile := "arq.bmp" para ver se cria na pasta do executável e nada. Interessante que o resultado do nResp é nil. Sem entender o porque.

    e o qrDLL tem algum valor? se sim qual?

  5. 1 hora atrás, wanderso disse:

    Olá pessoal. Alguém esta usando essa dll para gerar qrcode? O exemplo abaixo não cria o arquivo bitmap do qr. Valeu!

     

    #include "Fivewin.ch"

    Static Function Main()

    cStr:="conteúdo do_qrcode"

    cFile:="c:\teste\arq.bmp"

    QRcode(cStr,cFile)

    quit


    **----------------------------------------------------------**

    FUNCTION QRcode(cStr,cFile)

    **----------------------------------------------------------**

    #Define DC_CALL_STD 0x0020

    LOCAL qrDLL

    Generar_QR(cStr,cFile)

    RETURN(NIL)

    FUNC Generar_QR(cStr,cFile)
    LOCAL nResp
    LOCAL qrDLL
    qrDLL:=LoadLibrary("QRCodelib.Dll" )
    nResp:=DllCall(qrDLL,DC_CALL_STD,"FastQRCode",cStr,cFile)
    FreeLibrary(qrDLL)
    RETURN (NIL)

     

    eu fiz esse exemplo e funciona normal. Veja que o arquivo criado neste exemplo direciona para a pasta C:\TESTE

    Minha pergunta é: vc tem essa pasta TESTE criada no seu crive C: ? Acredito que o ideal é vc direcionar para a pasta da sua aplicação, deixando só:

    cFile := "arq.bmp"

     

    Outra coisa, a dll QRCODELIB.DLL tem que estar na mesma pasta do seu executavel

  6. 1 hora atrás, Theotokos disse:

    * (62/63) Compilando test_pix.c
    Embarcadero C++ 7.40 for Win32 Copyright (c) 1993-2018 Embarcadero Technologies, Inc.
    .\test_pix.c:
    Warning W8071 D:\\Tools\\QRCode\\test_pix.prg 128: Conversion may lose significant digits in function crc_ccitt_generic
    Warning W8071 D:\\Tools\\QRCode\\test_pix.prg 129: Conversion may lose significant digits in function crc_ccitt_generic
    Warning W8071 D:\\Tools\\QRCode\\test_pix.prg 130: Conversion may lose significant digits in function crc_ccitt_generic
    *** 1 errors in Compile ***
    Fim do script de compilacao!

    utilizo xHarbour 123 e bcc74  e utilizo xDev72 para editar e compilar

    E Não fiz nenhuma mudança, apenas baixei e incluir no projeto de um sistema meu

    essas mensagens são de warning e não é erro. Certamente não é isso que está dando erro.

    Faça o teste de maneira isolada, sem colocar no seu projeto. Após tudo funcionando aí sim coloque.

  7. 31 minutos atrás, Theotokos disse:

    Eu utilizo xHarbour 123 e bcc74  e utilizo xDev72 para editar e compilar

    E Não fiz nenhuma mudança, apenas baixei e incluir no projeto de um sistema meu

    printa a tela com o erro (ou warning)

  8. É um warning ou é um erro? Você pode postar um print da tela?

    Você fez alguma mudança no test_pix.prg ? Estranho ter erro de compilação pois compilo normalmente. Meu xHarbour é o comercial e compilo pelo xBuild

    Se o seu xharbour não é o comercial possivelmente é algo que você precisa setar na hora da compilação deste código que é em C.

     

  9. Quando eu comercializava a solução em desktop, minha solução para proteger contra pirataria foi gerar uma KEY para o cliente com base na razão social do cadastro de empresa e a data de validade da key.

    Então o cara até conseguia copiar o sistema porem todos os relatórios sairiam com a razão social liberada e se ele alterasse a razão social, a key se tornaria inválida e ele teria que pedir a nova key ou usar o sistema com a razão social de outro.

    Se quiser adotar esse modelo me avisa que preparo um exemplo simples e vc mesmo poderá alterar o algoritmo de geração da KEY a seu gosto.

  10. 12 horas atrás, Theotokos disse:

    OBGDAO

    Eu refatorei o código e tirei tudo que não era necessário, nele tinha várias funções de CRC e eu deixei apenas a que é usada para gerar o PIX.

    Então clone novamente o repositório pra pegar as ultimas modificações que eu fiz, compile o código e executa. Veja se continua o problema.

    Lembrando que é necessário colocar as libs do fivewin.

  11. Apanhei muito nessa questão de CRC no xHarbour, então busquei as funcoes em C de diversos algoritmos e adaptei a minha necessidade. Segue ai 4 algoritmos de CRC, sendo que o Kermit tem uma variante para inverter os bytes. Veja qual algoritmo é o que você precisa e bom trabalho.

     

    Function u_Teste()
    Local cTexto := "teste crc"
    
    ? "EMTCRC_CCITT_FFFF", cTexto, EMTCRC_CCITT_FFFF(cTexto)
    ? "EMTCRC_CRC_16", cTexto, EMTCRC_CRC_16(cTexto)
    ? "EMTCRC_CRC_MODBUS", cTexto, EMTCRC_CRC_MODBUS(cTexto)
    ? "EMTCRC_CRC_KERMIT (invert=.t.)", cTexto, EMTCRC_CRC_KERMIT(cTexto)
    ? "EMTCRC_CRC_KERMIT (invert=.f.)", cTexto, EMTCRC_CRC_KERMIT(cTexto, .f.)
    
    Return
    
    
    
    Function EMTCRC_CCITT_FFFF(cTexto)
    Local cCrc,nCrc
    nCrc := C_EMTCRC_CCITT_FFFF(cTexto)
    cCrc := NumToHex(nCrc)
    cCrc := PadL(NumToHex(nCrc), 4, "0")
    Return cCrc
    
    Function EMTCRC_CRC_16(cTexto)
    Local cCrc,nCrc
    nCrc := C_EMTCRC_CRC_16(cTexto)
    cCrc := NumToHex(nCrc)
    cCrc := PadL(NumToHex(nCrc), 4, "0")
    Return cCrc
    
    Function EMTCRC_CRC_MODBUS(cTexto)
    Local cCrc,nCrc
    nCrc := C_EMTCRC_CRC_MODBUS(cTexto)
    cCrc := NumToHex(nCrc)
    cCrc := PadL(NumToHex(nCrc), 4, "0")
    Return cCrc
    
    
    Function EMTCRC_CRC_KERMIT(cTexto, lInvert)
    Local cCrc, nCrc, nI
    If lInvert == nil
        lInvert := .t.
    EndIf
    
    nCrc := C_EMTCRC_CRC_KERMIT(cTexto)
    cCrc := PadL(NumToHex(nCrc), 4, "0")
    
    If lInvert
        cCrc_Str := HexTostr(cCrc)
        cCrc := ""
        For nI := Len(cCrc_Str) to 1 Step -1
            cCrc+=cCrc_Str[nI]
        Next
        cCrc := StrToHex(cCrc)
    EndIf
    
    Return cCrc
        
    
    #pragma BEGINDUMP
    #include "windows.h"
    #include "hbapi.h"
    #include <stdio.h>
    #include <stdint.h>
    #include <stdbool.h>
    
    #ifndef DEF_LIBCRC_CHECKSUM_H
    #define DEF_LIBCRC_CHECKSUM_H
    
    
    #define		CRC_POLY_16		0xA001
    #define		CRC_POLY_32		0xEDB88320L
    #define		CRC_POLY_CCITT		0x1021
    #define		CRC_POLY_DNP		0xA6BC
    #define		CRC_POLY_KERMIT		0x8408
    #define		CRC_POLY_SICK		0x8005
    
    #define		CRC_START_8		0x00
    #define		CRC_START_16		0x0000
    #define		CRC_START_MODBUS	0xFFFF
    #define		CRC_START_XMODEM	0x0000
    #define		CRC_START_CCITT_1D0F	0x1D0F
    #define		CRC_START_CCITT_FFFF	0xFFFF
    #define		CRC_START_KERMIT	0x0000
    #define		CRC_START_SICK		0x0000
    #define		CRC_START_DNP		0x0000
    #define		CRC_START_32		0xFFFFFFFFL
    
    unsigned char *		checksum_NMEA(     const unsigned char *input_str, unsigned char *result  );
    uint8_t			crc_8(             const unsigned char *input_str, size_t num_bytes       );
    uint16_t		crc_16(            const unsigned char *input_str, size_t num_bytes       );
    uint32_t		crc_32(            const unsigned char *input_str, size_t num_bytes       );
    uint16_t		crc_ccitt_1d0f(    const unsigned char *input_str, size_t num_bytes       );
    uint16_t		crc_ccitt_ffff(    const unsigned char *input_str, size_t num_bytes       );
    uint16_t		crc_dnp(           const unsigned char *input_str, size_t num_bytes       );
    uint16_t		crc_kermit(        const unsigned char *input_str, size_t num_bytes       );
    uint16_t		crc_modbus(        const unsigned char *input_str, size_t num_bytes       );
    uint16_t		crc_sick(          const unsigned char *input_str, size_t num_bytes       );
    uint16_t		crc_xmodem(        const unsigned char *input_str, size_t num_bytes       );
    uint8_t			update_crc_8(      uint8_t  crc, unsigned char c                          );
    uint16_t		update_crc_16(     uint16_t crc, unsigned char c                          );
    uint32_t		update_crc_32(     uint32_t crc, unsigned char c                          );
    uint16_t		update_crc_ccitt(  uint16_t crc, unsigned char c                          );
    uint16_t		update_crc_dnp(    uint16_t crc, unsigned char c                          );
    uint16_t		update_crc_kermit( uint16_t crc, unsigned char c                          );
    uint16_t		update_crc_sick(   uint16_t crc, unsigned char c, unsigned char prev_byte );
    
    #endif  // DEF_LIBCRC_CHECKSUM_H
    
    
    static uint16_t		crc_ccitt_generic( const unsigned char *input_str, size_t num_bytes, uint16_t start_value );
    static void             init_crcccitt_tab( void );
    
    static bool             crc_tabccitt_init       = false;
    static uint16_t         crc_tabccitt[256];
    
    static void		init_crc_tab( void );
    
    static bool		crc_tab_init		= false;
    static uint16_t		crc_tab[256];
    
    /*
     * uint16_t crc_xmodem( const unsigned char *input_str, size_t num_bytes );
     *
     * The function crc_xmodem() performs a one-pass calculation of an X-Modem CRC
     * for a byte string that has been passed as a parameter.
     */
    
    uint16_t crc_xmodem( const unsigned char *input_str, size_t num_bytes ) {
    
    	return crc_ccitt_generic( input_str, num_bytes, CRC_START_XMODEM );
    
    }  /* crc_xmodem */
    
    /*
     * uint16_t crc_ccitt_1d0f( const unsigned char *input_str, size_t num_bytes );
     *
     * The function crc_ccitt_1d0f() performs a one-pass calculation of the CCITT
     * CRC for a byte string that has been passed as a parameter. The initial value
     * 0x1d0f is used for the CRC.
     */
    
    uint16_t crc_ccitt_1d0f( const unsigned char *input_str, size_t num_bytes ) {
    
    	return crc_ccitt_generic( input_str, num_bytes, CRC_START_CCITT_1D0F );
    
    }  /* crc_ccitt_1d0f */
    
    /*
     * uint16_t crc_ccitt_ffff( const unsigned char *input_str, size_t num_bytes );
     *
     * The function crc_ccitt_ffff() performs a one-pass calculation of the CCITT
     * CRC for a byte string that has been passed as a parameter. The initial value
     * 0xffff is used for the CRC.
     */
    
    uint16_t crc_ccitt_ffff( const unsigned char *input_str, size_t num_bytes ) {
    
    	return crc_ccitt_generic( input_str, num_bytes, CRC_START_CCITT_FFFF );
    
    }  /* crc_ccitt_ffff */
    
    /*
     * static uint16_t crc_ccitt_generic( const unsigned char *input_str, size_t num_bytes, uint16_t start_value );
     *
     * The function crc_ccitt_generic() is a generic implementation of the CCITT
     * algorithm for a one-pass calculation of the CRC for a byte string. The
     * function accepts an initial start value for the crc.
     */
    
    static uint16_t crc_ccitt_generic( const unsigned char *input_str, size_t num_bytes, uint16_t start_value ) {
    
    	uint16_t crc;
    	uint16_t tmp;
    	uint16_t short_c;
    	const unsigned char *ptr;
    	size_t a;
    
    	if ( ! crc_tabccitt_init ) init_crcccitt_tab();
    
    	crc = start_value;
    	ptr = input_str;
    
    	if ( ptr != NULL ) for (a=0; a<num_bytes; a++) {
    
    		short_c = 0x00ff & (unsigned short) *ptr;
    		tmp     = (crc >> 8) ^ short_c;
    		crc     = (crc << 8) ^ crc_tabccitt[tmp];
    
    		ptr++;
    	}
    
    	return crc;
    
    }  /* crc_ccitt_generic */
    
    /*
     * uint16_t update_crc_ccitt( uint16_t crc, unsigned char c );
     *
     * The function update_crc_ccitt() calculates a new CRC-CCITT value based on
     * the previous value of the CRC and the next byte of the data to be checked.
     */
    
    uint16_t update_crc_ccitt( uint16_t crc, unsigned char c ) {
    
    	int16_t tmp;
    	int16_t short_c;
    
    	short_c  = 0x00ff & (uint16_t) c;
    
    	if ( ! crc_tabccitt_init ) init_crcccitt_tab();
    
    	tmp = (crc >> 8) ^ short_c;
    	crc = (crc << 8) ^ crc_tabccitt[tmp];
    
    	return crc;
    
    }  /* update_crc_ccitt */
    
    /*
     * static void init_crcccitt_tab( void );
     *
     * For optimal performance, the routine to calculate the CRC-CCITT uses a
     * lookup table with pre-compiled values that can be directly applied in the
     * XOR action. This table is created at the first call of the function by the
     * init_crcccitt_tab() routine.
     */
    
    static void init_crcccitt_tab( void ) {
    
    	uint16_t i;
    	uint16_t j;
    	uint16_t crc;
    	uint16_t c;
    
    	for (i=0; i<256; i++) {
    
    		crc = 0;
    		c   = i << 8;
    
    		for (j=0; j<8; j++) {
    
    			if ( (crc ^ c) & 0x8000 ) crc = ( crc << 1 ) ^ CRC_POLY_CCITT;
    			else                      crc =   crc << 1;
    
    			c = c << 1;
    		}
    
    		crc_tabccitt[i] = crc;
    	}
    
    	crc_tabccitt_init = true;
    
    }
    // ========================================================================
    
    static void             init_crc16_tab( void );
    
    static bool             crc_tab16_init          = false;
    static uint16_t         crc_tab16[256];
    
    /*
     * uint16_t crc_16( const unsigned char *input_str, size_t num_bytes );
     *
     * The function crc_16() calculates the 16 bits CRC16 in one pass for a byte
     * string of which the beginning has been passed to the function. The number of
     * bytes to check is also a parameter. The number of the bytes in the string is
     * limited by the constant SIZE_MAX.
     */
    
    uint16_t crc_16( const unsigned char *input_str, size_t num_bytes ) {
    
    	uint16_t crc;
    	uint16_t tmp;
    	uint16_t short_c;
    	const unsigned char *ptr;
    	size_t a;
    
    	if ( ! crc_tab16_init ) init_crc16_tab();
    
    	crc = CRC_START_16;
    	ptr = input_str;
    
    	if ( ptr != NULL ) for (a=0; a<num_bytes; a++) {
    
    		short_c = 0x00ff & (uint16_t) *ptr;
    		tmp     =  crc       ^ short_c;
    		crc     = (crc >> 8) ^ crc_tab16[ tmp & 0xff ];
    
    		ptr++;
    	}
    
    	return crc;
    
    }  /* crc_16 */
    
    /*
     * uint16_t crc_modbus( const unsigned char *input_str, size_t num_bytes );
     *
     * The function crc_modbus() calculates the 16 bits Modbus CRC in one pass for
     * a byte string of which the beginning has been passed to the function. The
     * number of bytes to check is also a parameter.
     */
    
    uint16_t crc_modbus( const unsigned char *input_str, size_t num_bytes ) {
    
    	uint16_t crc;
    	uint16_t tmp;
    	uint16_t short_c;
    	const unsigned char *ptr;
    	size_t a;
    
    	if ( ! crc_tab16_init ) init_crc16_tab();
    
    	crc = CRC_START_MODBUS;
    	ptr = input_str;
    
    	if ( ptr != NULL ) for (a=0; a<num_bytes; a++) {
    
    		short_c = 0x00ff & (uint16_t) *ptr;
    		tmp     =  crc       ^ short_c;
    		crc     = (crc >> 8) ^ crc_tab16[ tmp & 0xff ];
    
    		ptr++;
    	}
    
    	return crc;
    
    }  /* crc_modbus */
    
    
    /*
     * uint16_t crc_kermit( const unsigned char *input_str, size_t num_bytes );
     *
     * The function crc_kermit() calculates the 16 bits Kermit CRC in one pass for
     * a byte string of which the beginning has been passed to the function. The
     * number of bytes to check is also a parameter.
     */
    
     uint16_t crc_kermit( const unsigned char *input_str, size_t num_bytes ) {
    
    uint16_t crc;
    uint16_t low_byte;
    uint16_t high_byte;
    const unsigned char *ptr;
    size_t a;
    
    if ( ! crc_tab_init ) init_crc_tab();
    
    crc = CRC_START_KERMIT;
    ptr = input_str;
    
    if ( ptr != NULL ) for (a=0; a<num_bytes; a++) {
    
       crc = (crc >> 8) ^ crc_tab[ (crc ^ (uint16_t) *ptr++) & 0x00FF ];
    }
    
    low_byte  = (crc & 0xff00) >> 8;
    high_byte = (crc & 0x00ff) << 8;
    crc       = low_byte | high_byte;
    
    return crc;
    
    }  /* crc_kermit */
    
    /*
    * static void init_crc_tab( void );
    *
    * For optimal performance, the  CRC Kermit routine uses a lookup table with
    * values that can be used directly in the XOR arithmetic in the algorithm.
    * This lookup table is calculated by the init_crc_tab() routine, the first
    * time the CRC function is called.
    */
    
    static void init_crc_tab( void ) {
    
    uint16_t i;
    uint16_t j;
    uint16_t crc;
    uint16_t c;
    
    for (i=0; i<256; i++) {
    
       crc = 0;
       c   = i;
    
       for (j=0; j<8; j++) {
    
          if ( (crc ^ c) & 0x0001 ) crc = ( crc >> 1 ) ^ CRC_POLY_KERMIT;
          else                      crc =   crc >> 1;
    
          c = c >> 1;
       }
    
       crc_tab[i] = crc;
    }
    
    crc_tab_init = true;
    
    }  /* init_crc_tab */
    
    
    /*
     * uint16_t update_crc_16( uint16_t crc, unsigned char c );
     *
     * The function update_crc_16() calculates a new CRC-16 value based on the
     * previous value of the CRC and the next byte of data to be checked.
     */
    
    uint16_t update_crc_16( uint16_t crc, unsigned char c ) {
    
    	uint16_t tmp;
    	uint16_t short_c;
    
    	short_c = 0x00ff & (uint16_t) c;
    
    	if ( ! crc_tab16_init ) init_crc16_tab();
    
    	tmp =  crc       ^ short_c;
    	crc = (crc >> 8) ^ crc_tab16[ tmp & 0xff ];
    
    	return crc;
    
    }  /* update_crc_16 */
    
    /*
     * static void init_crc16_tab( void );
     *
     * For optimal performance uses the CRC16 routine a lookup table with values
     * that can be used directly in the XOR arithmetic in the algorithm. This
     * lookup table is calculated by the init_crc16_tab() routine, the first time
     * the CRC function is called.
     */
    
    static void init_crc16_tab( void ) {
    
    	uint16_t i;
    	uint16_t j;
    	uint16_t crc;
    	uint16_t c;
    
    	for (i=0; i<256; i++) {
    
    		crc = 0;
    		c   = i;
    
    		for (j=0; j<8; j++) {
    
    			if ( (crc ^ c) & 0x0001 ) crc = ( crc >> 1 ) ^ CRC_POLY_16;
    			else                      crc =   crc >> 1;
    
    			c = c >> 1;
    		}
    
    		crc_tab16[i] = crc;
    	}
    
    	crc_tab16_init = true;
    
    }  /* init_crc16_tab */
    
    
    // ========================================================================
    HB_FUNC( C_EMTCRC_CCITT_FFFF ) // cText --> nTextCRC
    {
       hb_retnl( crc_ccitt_ffff( ( unsigned char *  ) hb_parc( 1 ), hb_parclen( 1 ) ) );
    
    }
    
    HB_FUNC( C_EMTCRC_CRC_16 ) // cText --> nTextCRC
    {
       hb_retnl( crc_16( ( unsigned char *  ) hb_parc( 1 ), hb_parclen( 1 ) ) );
    
    }
    
    HB_FUNC( C_EMTCRC_CRC_MODBUS ) // cText --> nTextCRC
    {
       hb_retnl( crc_modbus( ( unsigned char *  ) hb_parc( 1 ), hb_parclen( 1 ) ) );
    }
    
    HB_FUNC( C_EMTCRC_CRC_KERMIT ) // cText --> nTextCRC - codigo fonte obtido em https://github.com/lammertb/libcrc/tree/master/src
    {
       hb_retnl( crc_kermit( ( unsigned char *  ) hb_parc( 1 ), hb_parclen( 1 ) ) );
    }
    
    #pragma ENDDUMP
  12. 2 horas atrás, kapiaba disse:

    Vixyyyyy, já começou mal no primeiro teste, compilando com Harbour:

     

    
    Application
    ===========
       Path and name: C:\FWH1905\samples\MULTI01.exe (32 bits)
       Size: 3,976,704 bytes
       Compiler version: Harbour 3.2.0dev (r1603082110)
       FiveWin  version: FWH 19.05
       C compiler version: Borland/Embarcadero C++ 7.0 (32-bit)
       Windows version: 6.1, Build 7601 Service Pack 1
    	   Time from start: 0 hours 0 mins 1 secs 
       Error occurred at: 02/06/22, 11:28:25
       Error description: Error BASE/3012  Argument error: HB_THREADJOIN
       Args:
         [   1] = U   
         [   2] = U   
    	Stack Calls
    ===========
       Called from:  => HB_THREADJOIN( 0 )
       Called from: MULTI01.prg => MAIN( 22 )
    	/*
     * demonstration/test code for thread return complex values
     *    and detached locals created by thread and used after thread
     *    termination.
     *
     * Copyright 2008 Przemyslaw Czerpak <druzus / at / priv.onet.pl>
     *
     */
    	#include "FiveWin.ch"
    	#ifdef __XHARBOUR__
       #xtranslate hb_threadStart( <x,...> ) => StartThread( <x> )
       #xtranslate hb_threadJoin( <x,...> ) => JoinThread( <x> )
    #endif
    	static s_var
    	proc main()
       local xResult
       ? Version()
       ? "join:", hb_threadJoin( hb_threadStart( @thFunc() ), @xResult )
       ? "result:", xResult
       ? "static var type:", valtype( s_var )
       ? eval( s_var )
       ? eval( s_var )
    return
    	func thFunc()
       local i := 12345.678
       s_var := {|| i++ }
    return replicate( "Hello World!!! ", 3 )
    

     

    Regards, saludos.

    No script de compilação vc precisa setar que o executável gerado será multithread. Precisa pesquisar como faz essa setagem pq eu não me lembro o de tem que mudar.

     

×
×
  • Create New...