Solved

Indy IRC

Posted on 2004-08-18
2
823 Views
Last Modified: 2012-08-13
Hi,

I'm trying to use the indy IRC component to create a simple chat client, but I'm having some weird problems.
I have this code:

procedure TForm1.IRCMessage(Sender: TObject; AUser: TIdIRCUser;
  AChannel: TIdIRCChannel; Content: String);
begin
      Display1.Lines.Add('--' + PansiChar(AUser) + ': ' + Content); // Display1 is a memo
end;

Using that, this is what I get when some says something on the channel I have it join:
--? G: Test
Every nickname is replaced by something like that. I tried using String(AUser) and AnsiString(AUser) too, but they have the same results. I also looked at the indy demos, and I didn't find any examples for the IRC Component, so any help is appreciated.

Thanks,
- MelchaS
0
Comment
Question by:MelchaS
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 3

Accepted Solution

by:
Tyrsis earned 40 total points
ID: 11835229
Hello,

This is because AUser : TIdIRCUser is a class, not a string.  You can solve this problem by doing the following:

Display1.Lines.Add('--' + AUser.Nick + ': ' + Content);

Hope this helps.

Tyrsis
0
 

Author Comment

by:MelchaS
ID: 11838646
That works, thanks a lot.
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question