Attachment Problem

Giganews Newsgroups
Subject: Attachment Problem
Posted by:  Tom Hahn (tha…
Date: Sun, 17 Oct 2010

I am upgrading a program from Delphi 7 / Indy 10.0.18 (I think) to
Delphi 2010 / Indy 10.5.5 (bundled version).

I was using code to send an attachment which no longer compiles:

TIdAttachment.Create(Msg.MessageParts, UserSession.Attachment);

The compiler error is:

[DCC Error] EmailFrm.pas(188): E2034 Too many actual parameters
[DCC Warning] EmailFrm.pas(188): W1020 Constructing instance of
'TIdAttachment' containing abstract method

I tried eliminating the first parameter but that also is rejected. What
should I do?

Some secondary questions ---

Are there code examples anywhere?
How can I find out the version of Indy being used? (Delphi 2010 seems
to display it but Delphi 7 does not.)