attach file to email

Giganews Newsgroups
Subject: attach file to email
Posted by:  Don (dngolsopcak…@comcast.net)
Date: Fri, 24 Nov 2006

I'm attempting to convert the MailDemo from Delphi to CBuilder2006.  The
following is from the MsgEditor.pas file:

procedure TfrmMessageEditor.btnAttachmentClick(Sender: TObject);
begin
    if OpenDialog1.Execute then
      begin
          TIdAttachment.Create(IdMsgSend.MessageParts,OpenDialog1.FileName);
//        ResetAttachmentListView;
      end;
end;

This is what I have tried:

if(OpenDialog1->Execute())
{
TIdAttachment->Create(mesgMessage->MessageParts, OpenDialog1->FileName);
}

It gives me an error saying:

[C++ Error] email.cpp(175): E2108 Improper use of typedef 'TIdAttachment'

Could someone help me out with this?
Don

Replies