Solved

Indy IRC

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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Splash screen too shortlived 11 113
How to use Hashing sha1 in Delphi 2010 4 162
Convert Jpg /PNG To GIF 5 103
Magic Software info 18 105
A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

758 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

Need Help in Real-Time?

Connect with top rated Experts

27 Experts available now in Live!

Get 1:1 Help Now