Como chamar esta DLL ??

Como chamar esta DLL ??

Postby MGA » Tue Jul 22, 2008 12:53 pm

Sr. Antonio, por favor, seguindo estas informações como declarar esta DLL no meu sistema?

PMTG.DLL -> http://rapidshare.com/files/131598908/pmtg.dll.html


int __stdcall mt_startserver(HWND mywhnd, int conecmsg, int commumsg);
Esta é a primeira função que deve ser chamada. Se tiver sucesso na sua chamada, os terminais já conectarão
ao servidor.
mywhnd: Handle para a janela principal do programa do servidor, que é para onde a DLL irá mandar as
mensagens para troca de dados. Se não quiser receber as mensagens deve seu valor deve ser NULL.

conecmsg: Valor da mensagem que a DLL enviará quando um terminal conectar/desconectar.
commumsg: Valor da mensagem que a DLL enviará quando terminal enviar dados.
retorna: 1 se servidor inicializado com sucesso, 0 se houve algum erro.



// DECLARAÇÃO DE FUNÇÕES E ROTINAS

// INICIALIZAÇÃO E FINALIZAÇÃO
function mt_startserver(mywhnd: HWND; conecmsg: DWORD; commumsg: DWORD): DWORD; far; stdcall; external 'pmtg.dll';
procedure mt_finishserver; far; stdcall; external 'pmtg.dll';
function mt_connectlist: TTABSOCK; far; stdcall; external 'pmtg.dll';

// FUNÇÕES DE TRATAMENTO DE IP
function mt_inet_ntoa_inv(oip: DWORD): PChar; far; stdcall; external 'pmtg.dll';
function mt_inet_addr_inv(oip: String): DWORD; far; stdcall; external 'pmtg.dll';

// COMANDOS BÁSICOS PARA O TERMINAL
function mt_sendlive(id: DWORD): DWORD; far; stdcall; external 'pmtg.dll';
function mt_restart(id: DWORD): DWORD; far; stdcall; external 'pmtg.dll';
function mt_ftpmode(id: DWORD): DWORD; far; stdcall; external 'pmtg.dll';

// REDE
function mt_sendconfig(id: DWORD; var config: TSetupTCP): DWORD; far; stdcall; external 'pmtg.dll';
function mt_reqconfig(id: DWORD): DWORD; far; stdcall; external 'pmtg.dll';
function mt_getconfig(id: DWORD; var config: TSetupTCP): DWORD; far; stdcall; external 'pmtg.dll';
function mt_sendexconfig(id: DWORD; var configex: TExSetupTCP): DWORD; far; stdcall; external 'pmtg.dll';
function mt_reqexconfig(id: DWORD): DWORD; far; stdcall; external 'pmtg.dll';
function mt_getexconfig(id: DWORD; var configex: TExSetupTCP): DWORD; far; stdcall; external 'pmtg.dll';

// DISPLAY
function mt_backspace(id: DWORD): DWORD; far; stdcall; external 'pmtg.dll';
function mt_carret(id: DWORD): DWORD; far; stdcall; external 'pmtg.dll';
function mt_linefeed(id: DWORD): DWORD; far; stdcall; external 'pmtg.dll';
function mt_formfeed(id: DWORD): DWORD; far; stdcall; external 'pmtg.dll';
function mt_gotoxy(id: DWORD; lin: DWORD; col: DWORD): DWORD; far; stdcall; external 'pmtg.dll';
function mt_gotoxyref(id: DWORD; lin: DWORD; col: DWORD): DWORD; far; stdcall; external 'pmtg.dll';
function mt_dispstr(id: DWORD; var str: BYTE): DWORD; far; stdcall; external 'pmtg.dll';
function mt_dispch(id: DWORD; ch: BYTE): DWORD; far; stdcall; external 'pmtg.dll';
function mt_dispclrln(id: DWORD; lin: DWORD): DWORD; far; stdcall; external 'pmtg.dll';
function mt_seteditstring(id: DWORD; var str: BYTE; OnOff: DWORD; PassWord: DWORD): DWORD; far; stdcall; external 'pmtg.dll';
function mt_geteditstring(id: DWORD; var str: BYTE): DWORD; far; stdcall; external 'pmtg.dll';
function mt_reqeditstring(id: DWORD): DWORD; far; stdcall; external 'pmtg.dll';

// TECLADO
function mt_setenablekey(id: DWORD; OnOff: DWORD): DWORD; far; stdcall; external 'pmtg.dll';
function mt_getenablekey(id: DWORD): DWORD; far; stdcall; external 'pmtg.dll';
function mt_setcapslock(id: DWORD; OnOff: DWORD): DWORD; far; stdcall; external 'pmtg.dll';
function mt_getcapslock(id: DWORD): DWORD; far; stdcall; external 'pmtg.dll';
function mt_setnumlock(id: DWORD; OnOff: DWORD): DWORD; far; stdcall; external 'pmtg.dll';
function mt_getnumlock(id: DWORD): DWORD; far; stdcall; external 'pmtg.dll';
function mt_reset(id: DWORD): DWORD; far; stdcall; external 'pmtg.dll';
function mt_setbeep(id: DWORD; OnOff: DWORD): DWORD; far; stdcall; external 'pmtg.dll';
function mt_setbeepkey(id: DWORD; OnOff: DWORD): DWORD; far; stdcall; external 'pmtg.dll';
function mt_getkey(id: DWORD; var buf: BYTE): DWORD; far; stdcall; external 'pmtg.dll';
function mt_programkbd(id: DWORD; var codigo: BYTE): DWORD; far; stdcall; external 'pmtg.dll';

// SERIAL
function mt_setenableserial(id: DWORD; COM: BYTE; OnOff: DWORD): DWORD; far; stdcall; external 'pmtg.dll';
function mt_getenableserial(id: DWORD; COM: BYTE): DWORD; far; stdcall; external 'pmtg.dll';
function mt_sendbinserial(id: DWORD; COM: BYTE; var bin: BYTE; tam: BYTE): DWORD; far; stdcall; external 'pmtg.dll';
function mt_sendconfigserial(id: DWORD; var config: ARG_COM_SETUPSERIAL): DWORD; far; stdcall; external 'pmtg.dll';
function mt_reqconfigserial(id: DWORD; COM: BYTE): DWORD; far; stdcall; external 'pmtg.dll';
function mt_getconfigserial(id: DWORD; var config: ARG_COM_SETUPSERIAL): DWORD; far; stdcall; external 'pmtg.dll';
function mt_getserial(id: DWORD; var sercom: DWORD; var buf: array of BYTE): DWORD; far; stdcall; external 'pmtg.dll';
function mt_settermserial(id: DWORD; COM: DWORD; TERM: DWORD; OnOff: DWORD): DWORD; far; stdcall; external 'pmtg.dll';

// CARTÃO
function mt_sendsetcard(id: DWORD; OnOff: DWORD): DWORD; far; stdcall; external 'pmtg.dll';
function mt_reqgetcard(id: DWORD): DWORD; far; stdcall; external 'pmtg.dll';
function mt_getcardbuf(id: DWORD; var cardbuf: ARG_CARD): DWORD; far; stdcall; external 'pmtg.dll';
Last edited by MGA on Tue Jul 22, 2008 2:08 pm, edited 1 time in total.
ubiratanmga@gmail.com

FWH24.04
BCC7.3
HARBOUR3.2
xMate
Pelles´C
TDolphin
MGA
 
Posts: 1254
Joined: Mon Feb 25, 2008 2:54 pm
Location: Brasil/PR/Maringá

Postby MGA » Tue Jul 22, 2008 2:15 pm

Sr. Antonio...

Por favor pode me ajudar!

:)
ubiratanmga@gmail.com

FWH24.04
BCC7.3
HARBOUR3.2
xMate
Pelles´C
TDolphin
MGA
 
Posts: 1254
Joined: Mon Feb 25, 2008 2:54 pm
Location: Brasil/PR/Maringá

Postby Antonio Linares » Tue Jul 22, 2008 2:32 pm

int __stdcall mt_startserver(HWND mywhnd, int conecmsg, int commumsg);

in FWH:

DLL FUNCTION mt_startserver( hWnd AS LONG, nConecMsg AS LONG, nCommuMsg AS LONG ) AS LONG LIB "PMTG.DLL"
regards, saludos

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

Postby MGA » Tue Jul 22, 2008 5:19 pm

hgertec := LoadLibrary("PMTG.DLL")

DLL32 FUNCTION mt_startserver( hWnd AS LONG, nConecMsg AS LONG, nCommuMsg AS LONG ) AS WORD PASCAL LIB hgertec


Sr. Antonio, assim funcinou... :D

E as outras funções SR. Antonio, como devo proceder?
ubiratanmga@gmail.com

FWH24.04
BCC7.3
HARBOUR3.2
xMate
Pelles´C
TDolphin
MGA
 
Posts: 1254
Joined: Mon Feb 25, 2008 2:54 pm
Location: Brasil/PR/Maringá

Postby MGA » Tue Jul 22, 2008 7:13 pm

Sr. Antonio, por favor, ao menos estas 3 declarações já me servirão...

Sr. Antonio, Por favor...
Sr. Antonio, Please...



function mt_connectlist: TTABSOCK; far; stdcall; external 'pmtg.dll';


function mt_restart(id: DWORD): DWORD; far; stdcall; external 'pmtg.dll';


function mt_seteditstring(id: DWORD; var str: BYTE; OnOff: DWORD; PassWord: DWORD): DWORD; far; stdcall; external 'pmtg.dll';
ubiratanmga@gmail.com

FWH24.04
BCC7.3
HARBOUR3.2
xMate
Pelles´C
TDolphin
MGA
 
Posts: 1254
Joined: Mon Feb 25, 2008 2:54 pm
Location: Brasil/PR/Maringá

Postby Antonio Linares » Tue Jul 22, 2008 10:46 pm

Como esta definido TTABSOCK, asi ?
Code: Select all  Expand view  RUN
Public Type TTABSOCK
    TabSock                     As Long 'Número do Winsock
    HeartBeat                  As Boolean
End Type
regards, saludos

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

Postby MGA » Wed Jul 23, 2008 4:57 pm

Sr. Antonio, segue abaixo uma parte do fonte em DELPHI:


FONTE:

// SERVIDOR COM SUPORTE AOS MICROTERMINAIS: GE 750, GE 760, MT 740, MT720

unit Unit1;

// INTERFACE

interface

uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ComCtrls, StdCtrls, ExtCtrls, Winsock, Grids;

// DECLARAÇÃO DE TIPOS, COMPONENTES, PROCEDURES E FUNÇÕES GERAIS

type TTABSOCK = packed record
TSOCK: array [0..255] of DWORD;
end;

type TSetupTCP = packed record
microT_IP: DWORD; // Endereço IP do terminal
server_IP: DWORD; // Endereço IP do servidor
msknet_IP: DWORD; // Máscara de rede
bDHCP: DWORD; // 1 = IP dinâmico, 0 = IP fixo
end;

type TExSetupTCP = packed record
gateway: DWORD; // IP do gateway
nameserver: DWORD; // IP do servidor de nomes
myname: array [1..16] of BYTE; // Nome do terminal
end;

type TSetupSerial = packed record
baud: DWORD; // Baud Rate: 1200 a 115.200
bits: WORD; // Data Bits
parity: WORD; // Paridade
stops: WORD; // Stop Bits
handshaking: BYTE; // 0 = Sem Hand Shaking, 1 = RTS/CTS
end;

type ARG_COM_SETUPSERIAL = packed record
com: BYTE;
Setup: TSetupSerial;
end;

type ARG_CARD = packed record
card: array [0..128] of BYTE;
status: DWORD;
end;

type
TForm1 = class(TForm)
Serial: TPageControl;
TabSheet1: TTabSheet;
TabSheet2: TTabSheet;
TabSheet3: TTabSheet;
ListBox1: TListBox;
btnRestart: TButton;
btnFTPMode: TButton;
btnClear: TButton;
GroupBox1: TGroupBox;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
edtClienteIP: TEdit;
edtServerIP: TEdit;
edtNetMask: TEdit;
chkDynamicIP: TCheckBox;
btnEnviarConfNet: TButton;
btnReceberConfNet: TButton;
GroupBox2: TGroupBox;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
edtGateWay: TEdit;
edtNameServer: TEdit;
edtTCName: TEdit;
btnEnviarConfExNet: TButton;
btnReceberConfExNet: TButton;
btnBackSpace: TButton;
btnCarRet: TButton;
btnFormFeed: TButton;
btnLineFeed: TButton;
btnGoToXY: TButton;
btnGoToXYRef: TButton;
btnDispStr: TButton;
btnDispChar: TButton;
edtGoToXY1: TEdit;
edtGoToXY2: TEdit;
edtGoToXYRef2: TEdit;
edtGoToXYRef1: TEdit;
btnDispClrLn: TButton;
edtDispStr: TEdit;
edtDispChar: TEdit;
edtDispClrLn: TEdit;
GroupBox3: TGroupBox;
GroupBox4: TGroupBox;
edtString: TEdit;
chkPassWord: TCheckBox;
btnHabilitaString: TButton;
btnDesabilitaString: TButton;
btnStatus: TButton;
chkEco: TCheckBox;
Button23: TButton;
TabSheet4: TTabSheet;
GroupBox7: TGroupBox;
GroupBox8: TGroupBox;
Label7: TLabel;
Label8: TLabel;
Label9: TLabel;
Label10: TLabel;
Label11: TLabel;
Label12: TLabel;
cbPorta: TComboBox;
cbBaud: TComboBox;
cbBits: TComboBox;
cbParidade: TComboBox;
cbStop: TComboBox;
cbHand: TComboBox;
btnHabilitaSerial: TButton;
btnDesabilitaSerial: TButton;
btnSendBinSerial: TButton;
btnGetEnableSerial: TButton;
edtSendBinSerial: TEdit;
GroupBox9: TGroupBox;
rdAtivaByte: TRadioButton;
rdDesativaByte: TRadioButton;
edtByte: TEdit;
Label13: TLabel;
btnSolicitaPeso: TButton;
btnEnviarConfSerial: TButton;
btnRecebeConfSerial: TButton;
TabSheet5: TTabSheet;
GroupBox10: TGroupBox;
btnHabilitarCartao: TButton;
btnDesabilitarCartao: TButton;
btnGetCard: TButton;
edtCartao: TEdit;
Timer1: TTimer;
ListReceive: TListBox;
btnAtualizar: TButton;
GroupBox12: TGroupBox;
btnReset: TButton;
btnGrava20: TButton;
btnGrava44: TButton;
btnBeepOn: TButton;
btnBeepOff: TButton;
btnBeepKeyOn: TButton;
btnBeepKeyOff: TButton;
GroupBox5: TGroupBox;
GroupBox6: TGroupBox;
GroupBox13: TGroupBox;
rdDesativado1: TRadioButton;
rdAtivado2: TRadioButton;
rdDesativado2: TRadioButton;
rdAtivado3: TRadioButton;
rdDesativado3: TRadioButton;
btnGetEnableKey: TButton;
btnGetCapsLock: TButton;
btnGetNumLock: TButton;
rdAtivado1: TRadioButton;
rdString: TRadioButton;
rdByte: TRadioButton;
OpenDialog1: TOpenDialog;
Timer2: TTimer;
procedure WndProc(var Message : TMessage); override;
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
procedure btnAtualizarClick(Sender: TObject);
procedure btnRestartClick(Sender: TObject);
procedure btnFTPModeClick(Sender: TObject);
procedure btnClearClick(Sender: TObject);
procedure btnReceberConfNetClick(Sender: TObject);
procedure btnEnviarConfNetClick(Sender: TObject);
procedure btnReceberConfExNetClick(Sender: TObject);
procedure btnEnviarConfExNetClick(Sender: TObject);
procedure btnBackSpaceClick(Sender: TObject);
procedure btnCarRetClick(Sender: TObject);
procedure btnFormFeedClick(Sender: TObject);
procedure btnLineFeedClick(Sender: TObject);
procedure btnGoToXYClick(Sender: TObject);
procedure btnGoToXYRefClick(Sender: TObject);
procedure btnDispStrClick(Sender: TObject);
procedure btnDispCharClick(Sender: TObject);
procedure btnDispClrLnClick(Sender: TObject);
procedure btnHabilitaStringClick(Sender: TObject);
procedure btnDesabilitaStringClick(Sender: TObject);
procedure btnStatusClick(Sender: TObject);
procedure rdAtivado1Click(Sender: TObject);
procedure rdDesativado1Click(Sender: TObject);
procedure btnGetEnableKeyClick(Sender: TObject);
procedure rdAtivado2Click(Sender: TObject);
procedure rdDesativado2Click(Sender: TObject);
procedure btnGetCapsLockClick(Sender: TObject);
procedure rdAtivado3Click(Sender: TObject);
procedure rdDesativado3Click(Sender: TObject);
procedure btnGetNumLockClick(Sender: TObject);
procedure btnResetClick(Sender: TObject);
procedure btnBeepOnClick(Sender: TObject);
procedure btnBeepOffClick(Sender: TObject);
procedure btnBeepKeyOnClick(Sender: TObject);
procedure btnBeepKeyOffClick(Sender: TObject);
procedure btnHabilitaSerialClick(Sender: TObject);
procedure btnDesabilitaSerialClick(Sender: TObject);
procedure btnGetEnableSerialClick(Sender: TObject);
procedure btnSendBinSerialClick(Sender: TObject);
procedure btnEnviarConfSerialClick(Sender: TObject);
procedure btnRecebeConfSerialClick(Sender: TObject);
procedure rdAtivaByteClick(Sender: TObject);
procedure rdDesativaByteClick(Sender: TObject);
procedure btnSolicitaPesoClick(Sender: TObject);
procedure btnHabilitarCartaoClick(Sender: TObject);
procedure btnDesabilitarCartaoClick(Sender: TObject);
procedure btnGetCardClick(Sender: TObject);
procedure btnGrava44Click(Sender: TObject);
procedure btnGrava20Click(Sender: TObject);
procedure Timer2Timer(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

// VARIÁVEIS

Const IDvLive = 2;

Const IDvGetSetupTCP = 8;
Const IDvGetExSetupTCP = 84;

Const IDvBackSpace = 34;
Const IDvCarRet = 36;
Const IDvLineFeed = 38;
Const IDvFormFeed = 40;
Const IDvGoToXY = 42;
Const IDvGoToXYRef = 44;
Const IDvDispStr = 52;
Const IDvDispCh = 54;
Const IDvDispClrLn = 56;
Const IDvSetEditString = 48;
Const IDbGetEditString = 50;
Const IDbReadEditString = 45;

Const IDcGetCharTerm = 29;
Const IDvSetEnableKey = 16;
Const IDbGetEnableKey = 18;
Const IDvSetCapsLock = 22;
Const IDbGetCapsLock = 24;
Const IDvSetNumLock = 26;
Const IDbGetNumLock = 28;
Const IDvReset = 20;
Const IDvSetBeep = 94;
Const IDvSetBeepKey = 96;

Const IDvSetEnableSerial = 58;
Const IDbGetEnableSerial = 60;
Const IDbSetSetupSerial = 66;
Const IDvGetSetupSerial = 68;
Const IDbGetBinSerial = 61;

Const IDvSetCard = 10;
Const IDbGetCard = 12;
Const IDbReadBuffCard = 13;

var
Form1: TForm1;
MsgReceiveData: LONGINT;
// CONNECT_MSG: LONGINT;

implementation

var
tabcon: TTABSOCK;
auxIP: TINADDR;
id_selecionado: Integer;

{$R *.DFM}

// DECLARAÇÃO DE FUNÇÕES E ROTINAS

// INICIALIZAÇÃO E FINALIZAÇÃO
function mt_startserver(mywhnd: HWND; conecmsg: DWORD; commumsg: DWORD): DWORD; far; stdcall; external 'pmtg.dll';
procedure mt_finishserver; far; stdcall; external 'pmtg.dll';
function mt_connectlist: TTABSOCK; far; stdcall; external 'pmtg.dll';

// FUNÇÕES DE TRATAMENTO DE IP
function mt_inet_ntoa_inv(oip: DWORD): PChar; far; stdcall; external 'pmtg.dll';
function mt_inet_addr_inv(oip: String): DWORD; far; stdcall; external 'pmtg.dll';

// COMANDOS BÁSICOS PARA O TERMINAL
function mt_sendlive(id: DWORD): DWORD; far; stdcall; external 'pmtg.dll';
function mt_restart(id: DWORD): DWORD; far; stdcall; external 'pmtg.dll';
function mt_ftpmode(id: DWORD): DWORD; far; stdcall; external 'pmtg.dll';

// REDE
function mt_sendconfig(id: DWORD; var config: TSetupTCP): DWORD; far; stdcall; external 'pmtg.dll';
function mt_reqconfig(id: DWORD): DWORD; far; stdcall; external 'pmtg.dll';
function mt_getconfig(id: DWORD; var config: TSetupTCP): DWORD; far; stdcall; external 'pmtg.dll';
function mt_sendexconfig(id: DWORD; var configex: TExSetupTCP): DWORD; far; stdcall; external 'pmtg.dll';
function mt_reqexconfig(id: DWORD): DWORD; far; stdcall; external 'pmtg.dll';
function mt_getexconfig(id: DWORD; var configex: TExSetupTCP): DWORD; far; stdcall; external 'pmtg.dll';

// DISPLAY
function mt_backspace(id: DWORD): DWORD; far; stdcall; external 'pmtg.dll';
function mt_carret(id: DWORD): DWORD; far; stdcall; external 'pmtg.dll';
function mt_linefeed(id: DWORD): DWORD; far; stdcall; external 'pmtg.dll';
function mt_formfeed(id: DWORD): DWORD; far; stdcall; external 'pmtg.dll';
function mt_gotoxy(id: DWORD; lin: DWORD; col: DWORD): DWORD; far; stdcall; external 'pmtg.dll';
function mt_gotoxyref(id: DWORD; lin: DWORD; col: DWORD): DWORD; far; stdcall; external 'pmtg.dll';
function mt_dispstr(id: DWORD; var str: BYTE): DWORD; far; stdcall; external 'pmtg.dll';
function mt_dispch(id: DWORD; ch: BYTE): DWORD; far; stdcall; external 'pmtg.dll';
function mt_dispclrln(id: DWORD; lin: DWORD): DWORD; far; stdcall; external 'pmtg.dll';
function mt_seteditstring(id: DWORD; var str: BYTE; OnOff: DWORD; PassWord: DWORD): DWORD; far; stdcall; external 'pmtg.dll';
function mt_geteditstring(id: DWORD; var str: BYTE): DWORD; far; stdcall; external 'pmtg.dll';
function mt_reqeditstring(id: DWORD): DWORD; far; stdcall; external 'pmtg.dll';

// TECLADO
function mt_setenablekey(id: DWORD; OnOff: DWORD): DWORD; far; stdcall; external 'pmtg.dll';
function mt_getenablekey(id: DWORD): DWORD; far; stdcall; external 'pmtg.dll';
function mt_setcapslock(id: DWORD; OnOff: DWORD): DWORD; far; stdcall; external 'pmtg.dll';
function mt_getcapslock(id: DWORD): DWORD; far; stdcall; external 'pmtg.dll';
function mt_setnumlock(id: DWORD; OnOff: DWORD): DWORD; far; stdcall; external 'pmtg.dll';
function mt_getnumlock(id: DWORD): DWORD; far; stdcall; external 'pmtg.dll';
function mt_reset(id: DWORD): DWORD; far; stdcall; external 'pmtg.dll';
function mt_setbeep(id: DWORD; OnOff: DWORD): DWORD; far; stdcall; external 'pmtg.dll';
function mt_setbeepkey(id: DWORD; OnOff: DWORD): DWORD; far; stdcall; external 'pmtg.dll';
function mt_getkey(id: DWORD; var buf: BYTE): DWORD; far; stdcall; external 'pmtg.dll';
function mt_programkbd(id: DWORD; var codigo: BYTE): DWORD; far; stdcall; external 'pmtg.dll';

// SERIAL
function mt_setenableserial(id: DWORD; COM: BYTE; OnOff: DWORD): DWORD; far; stdcall; external 'pmtg.dll';
function mt_getenableserial(id: DWORD; COM: BYTE): DWORD; far; stdcall; external 'pmtg.dll';
function mt_sendbinserial(id: DWORD; COM: BYTE; var bin: BYTE; tam: BYTE): DWORD; far; stdcall; external 'pmtg.dll';
function mt_sendconfigserial(id: DWORD; var config: ARG_COM_SETUPSERIAL): DWORD; far; stdcall; external 'pmtg.dll';
function mt_reqconfigserial(id: DWORD; COM: BYTE): DWORD; far; stdcall; external 'pmtg.dll';
function mt_getconfigserial(id: DWORD; var config: ARG_COM_SETUPSERIAL): DWORD; far; stdcall; external 'pmtg.dll';
function mt_getserial(id: DWORD; var sercom: DWORD; var buf: array of BYTE): DWORD; far; stdcall; external 'pmtg.dll';
function mt_settermserial(id: DWORD; COM: DWORD; TERM: DWORD; OnOff: DWORD): DWORD; far; stdcall; external 'pmtg.dll';

// CARTÃO
function mt_sendsetcard(id: DWORD; OnOff: DWORD): DWORD; far; stdcall; external 'pmtg.dll';
function mt_reqgetcard(id: DWORD): DWORD; far; stdcall; external 'pmtg.dll';
function mt_getcardbuf(id: DWORD; var cardbuf: ARG_CARD): DWORD; far; stdcall; external 'pmtg.dll';
ubiratanmga@gmail.com

FWH24.04
BCC7.3
HARBOUR3.2
xMate
Pelles´C
TDolphin
MGA
 
Posts: 1254
Joined: Mon Feb 25, 2008 2:54 pm
Location: Brasil/PR/Maringá

Postby MGA » Thu Jul 24, 2008 6:14 pm

UP! Antonio...
ubiratanmga@gmail.com

FWH24.04
BCC7.3
HARBOUR3.2
xMate
Pelles´C
TDolphin
MGA
 
Posts: 1254
Joined: Mon Feb 25, 2008 2:54 pm
Location: Brasil/PR/Maringá

Postby Antonio Linares » Fri Jul 25, 2008 1:08 am

Siguiendo la declaración de Delphi, imagino que serviría asi:

DLL FUNCTION mt_connectlist( pTabSock AS LPSTR ) AS VOID PASCAL LIB "pmtg.dll"

pTabSock has de definirlo como Space( 4 * 256 ) // sizeof( LONG ) * 256
regards, saludos

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

Postby MGA » Fri Jul 25, 2008 2:08 pm

Sr.Antonio, mais me parece que o retorno tem que ser um array, veja o que diz o manual:

Manual:

mt_connectlist
TTABSOCK __stdcall mt_connectlist(void);
typedef struct
{
DWORD ip[255];
} TTABSOCK;
TTABSOCK.ip[0]=0x00000000
TTABSOCK.tab[1]=0xB600A8C0
TTABSOCK.tab[2]=0x00000000

Indica que no ID “1”, existe um terminal conectado com o IP “B600A8C0” (192.168.0.182).
ubiratanmga@gmail.com

FWH24.04
BCC7.3
HARBOUR3.2
xMate
Pelles´C
TDolphin
MGA
 
Posts: 1254
Joined: Mon Feb 25, 2008 2:54 pm
Location: Brasil/PR/Maringá

Postby Antonio Linares » Fri Jul 25, 2008 6:37 pm

El array de valores DWORD (LONG) queda dentro de la variable caracter pTabSock que has definido como Space( 4 * 256 ).

Asi, el primer valor sería: Bin2L( SubStr( pTabSock, 1, 4 ) ) salvo que el orden de los bytes esté cambiado ("endianness").

El segundo Bin2L( SubStr( pTabSock, 5, 4 ) ), etc.
regards, saludos

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


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 60 guests