Forum > Portuguese
Problemas com o INDY 10
Gustavo 'Gus' Carreno:
Oies Emerson,
Se não compreenderes alguma coisa que o Remy está a falar, por favor não hesites em me perguntar e eu estarei mais que disponível para traduzir.
"If you don't understand some things that Remy is talking about, please don't hesitate and ask me for a translation. I'll be more than willing to help"
Abraço,
Gus
Emerson:
--- Quote from: Remy Lebeau on March 26, 2021, 01:58:45 am ---Are you still getting the same runtime error 232? Or are you having a different problem now? If so, what exactly? The code you have provided looks fine mostly, although I don't see the cthreads unit in the uses clause.
--- End quote ---
Olá Remmy!
Sim ainda estou com o mesmo erro.
Não sei como resolver!
Obrigado pela atenção!
Remy Lebeau:
--- Quote from: Emerson on March 26, 2021, 04:46:52 pm ---Sim ainda estou com o mesmo erro.
--- End quote ---
Like I said earlier, error 232 means you are not enabling threading support in your project, and I don't see the cthreads unit in your uses clause, eg:
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---unit TelaSockServer; {$mode objfpc}{$H+} interface uses {$IFDEF UNIX} cthreads, // <-- HERE!! {$ENDIF} Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, IdTCPServer, IdCustomTCPServer, IdContext; type { TForm1 } TForm1 = class(TForm) Button1: TButton; IdTCPServer1: TIdTCPServer; procedure Button1Click(Sender: TObject); procedure IdTCPServer1Execute(AContext: TIdContext); private public end; var Form1: TForm1; implementation {$R *.lfm} { TForm1 } procedure TForm1.IdTCPServer1Execute(AContext: TIdContext);var v_comando_recebido: String; v_mensagem : string;begin v_comando_recebido := AContext.Connection.Socket.ReadLn; v_mensagem := 'Certifico o recebimento do comando: ' + v_comando_recebido; AContext.Connection.Socket.WriteLn(v_mensagem); AContext.Connection.Disconnect;end; procedure TForm1.Button1Click(Sender: TObject);begin if IdTCPServer1.Active then begin IdTCPServer1.Active := false; end else begin IdTCPServer1.Active := true; end;end; end.
Fred vS:
Opa Emerson!
Além das informações de Remy, você também deve adicionar "cthreads" em "program", seção "uses":
[EDIT] O arquivo "program" tem a extensão 'lpr' : meuprograma.lpr
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---program meuprograma ;...uses {$ifdef unix} cthreads, {$endif} // aqui
Emerson:
--- Quote from: Remy Lebeau on March 26, 2021, 05:00:05 pm ---
--- Quote from: Emerson on March 26, 2021, 04:46:52 pm ---Sim ainda estou com o mesmo erro.
--- End quote ---
Like I said earlier, error 232 means you are not enabling threading support in your project, and I don't see the cthreads unit in your uses clause, eg:
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---unit TelaSockServer; {$mode objfpc}{$H+} interface uses {$IFDEF UNIX} cthreads, // <-- HERE!! {$ENDIF} Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, IdTCPServer, IdCustomTCPServer, IdContext; type { TForm1 } TForm1 = class(TForm) Button1: TButton; IdTCPServer1: TIdTCPServer; procedure Button1Click(Sender: TObject); procedure IdTCPServer1Execute(AContext: TIdContext); private public end; var Form1: TForm1; implementation {$R *.lfm} { TForm1 } procedure TForm1.IdTCPServer1Execute(AContext: TIdContext);var v_comando_recebido: String; v_mensagem : string;begin v_comando_recebido := AContext.Connection.Socket.ReadLn; v_mensagem := 'Certifico o recebimento do comando: ' + v_comando_recebido; AContext.Connection.Socket.WriteLn(v_mensagem); AContext.Connection.Disconnect;end; procedure TForm1.Button1Click(Sender: TObject);begin if IdTCPServer1.Active then begin IdTCPServer1.Active := false; end else begin IdTCPServer1.Active := true; end;end; end.
--- End quote ---
Olá!
Agora que eu inseri o código conforme você me instruiu, passou aparecer o seguinte erro logo no início da aplicação:
Projeto SockServer elevou classe exceção 'RunError(211)'.
No endereço EBF47C
Antes o erro 232 acontecia somente ao ativar o componetes, agora o erro 211 ocorre ao inicializar o form.
Desde já agradeço ajuda que você tem me prestado!
Navigation
[0] Message Index
[#] Next page
[*] Previous page