Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Varios
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Grupo de Teaming del ClubDelphi

Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 27-11-2014
JuanOrtega JuanOrtega is offline
Miembro
NULL
 
Registrado: sep 2011
Posts: 130
Poder: 13
JuanOrtega Va por buen camino
Problema con evento PrivateMessages en IdIRC

Hola tengo un problema con el siguiente codigo :

Código:
program test;

{$APPTYPE CONSOLE}
{$R *.res}

uses
  System.SysUtils, idIRC, idContext, idGlobal;


// procedure TForm1.IdIRC1PrivateMessage(ASender: TIdContext; const ANickname,
// AHost, ATarget, AMessage: string);

// procedure TForm1.IdIRC1Raw(ASender: TIdContext; AIn: Boolean;
// const AMessage: string);

procedure IrcPrivateMessage(ASelf: Pointer; const ANickname, AHost, ATarget,
  AMessage: string);
begin
  Writeln('[+] Message ' + ANickname + ' > ' + AMessage);
end;

procedure IrcRaw(ASelf: Pointer; ASender: TIdContext; AIn: Boolean;
  const AMessage: String);
begin
  Writeln(iif(AIn, '[Recv] ', '[Sent] ') + AMessage);
end;

var
  irc: TIdIRC;
  m1: TMethod;
  m2: TMethod;

begin
  try
    irc := TIdIRC.Create(nil);
    try
      irc.Host := 'localhost';
      irc.Port := 6667;
      irc.Nickname := 'tester';
      irc.Username := 'tester';

      m1.Code := @IrcRaw;
      m1.Data := irc;
      irc.OnRaw := TIdIRCRawEvent(m1);

      m2.Code := @IrcPrivateMessage;
      m2.Data := irc;
      irc.OnPrivateMessage := TIdIRCPrivMessageEvent(m2);

      try
        irc.Connect;
      except
        Writeln('Nay');
        Exit;
      end;

      Writeln('Yeah');

      irc.Join('#locos');

      while ('1' = '1') do
      begin
        //
      end;

    finally
      irc.Free;
    end;
  except
    on E: Exception do
      Writeln(E.ClassName, ': ', E.Message);
  end;

end.
Cita:
Project test.exe raised exeption class #C00000005 with message 'access violation at 0x00404673:read of adress 0x03cf4e58
Estoy usando el componente IdIRC con Delphi XE2 y al parecer solo pasa con el ANickname , ¿ como se soluciona ese error ?

Última edición por Casimiro Notevi fecha: 27-11-2014 a las 19:39:03.
Responder Con Cita
Respuesta



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
Como utilizar el idIRC de la Indy! fide Internet 0 25-11-2007 01:47:37
Problema con evento oncloseup snowlis Varios 7 25-04-2007 00:42:37
Problema con Delete en el evento OnKeyDown Durbed Varios 5 12-01-2007 14:54:29
Problema con evento AfterEdit de una grilla cybergerman OOP 0 14-07-2006 17:10:13
Problema con evento onNewRecord novaten Conexión con bases de datos 5 14-04-2005 22:07:04


La franja horaria es GMT +2. Ahora son las 13:00:16.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi