Edvaldo1361303230 Posted May 25, 2012 Report Share Posted May 25, 2012 Amigos só posso recorrer a voces. Alguem consegue declarar essas funcoes em C? me mande a fatura depois. Enviar Mensagem para o display: ( _stdcall *pfun_bSendDisplayMsg ) ( int ID, char *line1, char *line2, WORD timeExhibition, WORD typeAnimation ); Receber Código de Barras: ( _stdcall *pfun_bReceiveBarcode ) ( int *ID, int *porta, char *buffer, int *nBr ); Função para enviar o produto para o display quando encontrado: ( _stdcall *pfun_bSendProdPrice ) ( int ID, char *nameProd, char *priceProd ); Quando não encontrado: ( _stdcall *pfun_bSendProdNotFound ) ( int ID ); Todas do tipo BOOL Obrigado Edvaldo Quote Link to comment Share on other sites More sharing options...
Edvaldo1361303230 Posted May 25, 2012 Author Report Share Posted May 25, 2012 Amigos só posso recorrer a voces. Alguem consegue declarar essas funcoes em C? me mande a fatura depois. Enviar Mensagem para o display: ( _stdcall *pfun_bSendDisplayMsg ) ( int ID, char *line1, char *line2, WORD timeExhibition, WORD typeAnimation ); Receber Código de Barras: ( _stdcall *pfun_bReceiveBarcode ) ( int *ID, int *porta, char *buffer, int *nBr ); Função para enviar o produto para o display quando encontrado: ( _stdcall *pfun_bSendProdPrice ) ( int ID, char *nameProd, char *priceProd ); Quando não encontrado: ( _stdcall *pfun_bSendProdNotFound ) ( int ID ); Todas do tipo BOOL Obrigado Edvaldo Quote Link to comment Share on other sites More sharing options...
sambomb Posted May 25, 2012 Report Share Posted May 25, 2012 é de alguma DLL? RCA Sistemas - Itaocara - RJ Quote Link to comment Share on other sites More sharing options...
Edvaldo1361303230 Posted May 25, 2012 Author Report Share Posted May 25, 2012 é da sc501ger.dll gertec para controle de terminais. Do Manual da dll: bSendProdNotFound Envia Mensagem de produto não encontrado; function bSendProdNotFound(ID: Integer):boolean; stdcall; bSendDisplayMsg Envia Mensagem para o Display do terminal. function bSendDisplayMsg( ID: Integer; var Line1, Line2 : byte; TimeExhibition, TypeAnimation : WORD ): boolean; stdcall; - Line1/2: string com as mensagens de cada linha do display. - TimeExhibition: Tempo de exibição da mensagem. - TypeAnimation: Reservado, deve ser 48. bSendImageFromFile1 function bReceiveBarcode(var ID: integer; var Porta: integer;var buffer: byte; var Nbr: integer): boolean; stdcall; - ID: valor do SOCKET que enviou o dado. - Porta: porta que foi lido dados da serial. - buffer: dados recebidos da serial. - nbr: número de dados lido da serial. - Retorna: true se recebeu algum dado, false se não tem nenhum dado a ser lido. function bSendProdPrice(ID: Integer; var NameProd, PriceProd : byte): Boolean; stdcall; - NameProd: string com nome do produto; - PriceProd: string com preço do produto. Se alguem fizer pelo menos uma declaração já ajuda Obrigado Quote Link to comment Share on other sites More sharing options...
Kbelo Posted May 25, 2012 Report Share Posted May 25, 2012 ************* function main private hDLL := LoadLibrary( "suadll.dll" ) .... No final do prg apos o return DLL32 FUNCTION bSendDisplayMsg( ID AS INT, line1 AS LPSTR, line2 AS LPSTR, timeExhibition AS WORD, typeAnimation AS WORD ) AS BOOL PASCAL LIB hDLL DLL32 FUNCTION bReceiveBarcode( ID AS INT, PORTA AS INT, BUFFER AS LPSTR, NBR AS INT ) AS BOOL PASCAL LIB hDLL DLL32 FUNCTION bSendProdPrice( ID AS INT, nameProd AS LPSTR, priceProd AS LPSTR ) AS BOOL PASCAL LIB hDLL DLL32 FUNCTION bSendProdNotFound( ID AS INT) AS BOOL PASCAL LIB hDLL id=code>id=code>Veja se ajuda. Não sei se ira funcionar mas o caminho é por ai. Marcelo Michels E-mail:marcelo@folksistemas.com.br Msn/E-mail:celo.michels@hotmail.com xHarbour 1.2 + Fwh 106(originalid=red>) + Bcc 5.82 + SQLRDD + Mate. Quote Link to comment Share on other sites More sharing options...
gss200610 Posted May 25, 2012 Report Share Posted May 25, 2012 #pragma BEGINDUMP #include "hbpai.h" #include "windows.h" static HMODULE hdll = NULL; typedef BOOL ( _stdcall * _ BSENDDISPLAYMSG)(int id, char* line1, char* line2, long* timeExhibtion, long* typeAnimation); HB_FUNC( BSENDDISPLAYMSG) { _BSENDDISPLAYMSG pFunc = ( _BSENDDISPLAYMSG) GetProcAddress(hdll, "bSendDisplayMsg"); hb_retl( BOOL)pFunc( etc.....)); } #pragma ENDDUMP Gilmar Silva Santos Programador - Goiânia Go Não Recuarei, Nada Temerei, Comigo Está o Senhor. Email : gilmarss2010@gmail.com FWH 10.8, DBF, MED EDITOR, UESTUDIO, XHB 1.2, BCC 5.82 Quote Link to comment Share on other sites More sharing options...
Edvaldo1361303230 Posted May 26, 2012 Author Report Share Posted May 26, 2012 não entendi o etc... Quote Link to comment Share on other sites More sharing options...
Edvaldo1361303230 Posted May 28, 2012 Author Report Share Posted May 28, 2012 Pessoal estamos quase chegando la, o pessoal da gertec me passou está função antes de escrever no display dos terminais: Suporte On-Line - GERTEC> Função GetTabConectados: TTABSOCK ( _stdcall *pfun_GetTabConectados) (int nada); Suporte On-Line - GERTEC> typedef struct { int tabSock[1024]; DWORD tabIP[1024]; int numSockConec; } TTABSOCK; Esta função é equivalente a uma declaração feito pelo Gilmer para um outro equipamento e que está funcionando: #include "windows.h" #include "hbapi.h" #include "structs.h" static HINSTANCE handle = NULL; typedef TTABSOCK (WINAPI * _MT_CONNECTLIST)( void); HB_FUNC( MT_CONNECTLIST) { if (handle) { _MT_CONNECTLIST pFunc; TTABSOCK tsock; pFunc = (_MT_CONNECTLIST) GetProcAddress(handle, "mt_connectlist"); Sleep(200); tsock = pFunc( ); hb_reta(5); hb_storni(tsock.TabSock[1],-1,1); hb_storni(tsock.TabSock[2],-1,2); hb_storni(tsock.TabSock[3],-1,3); hb_storni(tsock.TabSock[4],-1,4); hb_storni(tsock.TabSock[5],-1,5); //hb_retc( pFunc ); } } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.