Solved

Indy IRC

Posted on 2004-08-18
2
829 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

[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
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…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses
Course of the Month9 days, 22 hours left to enroll

624 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