chamar proceduree
ola boa tarde eu criei uma unit para fazer minhas funçoes e procedures ate ai tudo bem so que nao nao to conseguindo chamalas em outro unit
eu ja coloquei essa unit no uses do outro form so que nao consigo chamar essa procedure imprimir la
unit Ufunc;
interface
uses uPrincipal, Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, ComCtrls, StdCtrls, ExtCtrls, Winsock, Grids;
implementation
// 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'''''''';
procedure imprimirtela(texto: String; id: integer; ListBox1: TListBox);
var
buf: array [0 .. 255] of BYTE;
i: integer;
begin
Try
// Verifica se há algum terminal selecionado
if (ListBox1.ItemIndex = -1) then
begin
Application.MessageBox(''''''''Selecione um terminal.'''''''', ''''''''Display'''''''', 48)
end
else
begin
for i := 0 to length(texto) - 1 do
begin
StrPCopy(@buf, texto[i + 1]);
// Envia o comando de DisplayString para o terminal
if mt_dispstr(id, buf[0]) < 1 then
begin
Application.MessageBox(''''''''Erro enviando comando.'''''''', ''''''''ERRO'''''''', 16);
end;
end;
end;
Except
Application.MessageBox(''''''''Preencha corretamento os campos.'''''''', ''''''''Display'''''''', 48);
end;
end;
end.eu ja coloquei essa unit no uses do outro form so que nao consigo chamar essa procedure imprimir la
Abner Carvalho
Curtidas 0
Melhor post
Abner Carvalho
21/09/2018
Ja conseguir resolver isso. erro de principiante so tive que declarar a procedura antes do implametation
GOSTEI 1