Board index » delphi » TIdAttachment.create problem (too many actual parameters)

TIdAttachment.create problem (too many actual parameters)


2005-10-06 06:25:54 PM
delphi180
Down below is a code where I get a 'Too many actual parameters' in
TIdAttachment.Create.
If I remove the file ('c:\tezt.jpg') then it compiles ok, why???
I'm using Delphi 5 and Indy 10
with TIdAttachment.Create(
connectf.idmessage1.MessageParts,'c:\tezt1.jpg') do // <--- do not
compile
Begin
ContentType := 'image/jpeg' ;
contenttransfer:='base64';
extraheaders.Add('Content-ID: <somelogo>');
end;
with TIdAttachment.Create( connectf.idmessage1.MessageParts) do
begin //<--- compiles ok....
ContentType := 'image/jpeg' ;
contenttransfer:='base64';
extraheaders.Add('Content-ID: <somelogo>');
end;
Regards
Leif Magne Svendsen
 
 

Re:TIdAttachment.create problem (too many actual parameters)

"Leif Magne Svendsen" <XXXX@XXXXX.COM>writes
Quote
Down below is a code where I get a 'Too many actual parameters'
in TIdAttachment.Create.
TIdAttachment is an abstract class in Indy 10. You cannot instantiate it
directly, nor does its constructor have a FileName parameter. You need to
use TIdAttachmentFile instead:
with TIdAttachmentFile.Create(connectf.idmessage1.MessageParts,
'c:\tezt1.jpg') do
//...
Quote
extraheaders.Add('Content-ID: <somelogo>');
You need to use the ContentID property instead:
ContentID := '<somelogo>';
Gambit
 

Re:TIdAttachment.create problem (too many actual parameters)

"Leif Magne Svendsen" <XXXX@XXXXX.COM>writes
Quote
Down below is a code
<snip>
Please do not post attachments here. They are only allowed in the
"borland.public.attachments" group.
Gambit