🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.internet.socket
8 messages
8 total messages Started by Pawe� Kurzawa Mon, 01 Oct 2007 19:39
TIdAttachmentFile generate: Type name expected
#745
Author: Pawe� Kurzawa
Date: Mon, 01 Oct 2007 19:39
18 lines
1398 bytes
Hello
I have bc++ 2007 and code like this:

IdMessage1->Body->Append("raport");
IdMessage1->Recipients->EMailAddresses = "a@a.pl";
IdMessage1->Subject = "Raport";
IdSMTP1->Password = "aaaa";
IdSMTP1->Username = "a@a.pl";
IdSMTP1->Host = "a.pl";
new TIdAttachmentFile(IdMessage1->MessageParts,"c:\tmp\a.txt");

in last line is compilation error:
[BCC32 Error] UObsluga.cpp(614): E2303 Type name expected

I havn't any idea, what's wrong...

Best Regards
Pawel 
Re: TIdAttachmentFile generate: Type name expected
#746
Author: Remy Lebeau (TeamB)
Date: Mon, 01 Oct 2007 20:23
23 lines
1492 bytes
"Pawe� Kurzawa" <pkurzawa@izissoft.pl> wrote in message
news:47014cce@newsgroups.borland.com...

> IdMessage1->Body->Append("raport");

Do not use the Body property if you are using the MessageParts collection.
Put the text into a TIdText object within the collection.

> new TIdAttachmentFile(IdMessage1->MessageParts,"c:\tmp\a.txt");

You have to use double slashes in string literals:

    new TIdAttachmentFile(IdMessage1->MessageParts,"c:\\tmp\\a.txt");

> [BCC32 Error] UObsluga.cpp(614): E2303 Type name expected

You likely did not include IdAttachmentFile.hpp into your code:

    #include "IdAttachmentFile.hpp"


Gambit
Re: TIdAttachmentFile generate: Type name expected
#747
Author: Pawe� Kurzawa
Date: Mon, 01 Oct 2007 20:25
30 lines
1828 bytes


U�ytkownik "Pawe� Kurzawa" <pkurzawa@izissoft.pl> napisa� w wiadomo�ci 
news:47014cce@newsgroups.borland.com...
> Hello
> I have bc++ 2007 and code like this:
>
> IdMessage1->Body->Append("raport");
> IdMessage1->Recipients->EMailAddresses = "a@a.pl";
> IdMessage1->Subject = "Raport";
> IdSMTP1->Password = "aaaa";
> IdSMTP1->Username = "a@a.pl";
> IdSMTP1->Host = "a.pl";
> new TIdAttachmentFile(IdMessage1->MessageParts,"c:\tmp\a.txt");
>
> in last line is compilation error:
> [BCC32 Error] UObsluga.cpp(614): E2303 Type name expected
>
> I havn't any idea, what's wrong...
>
> Best Regards
> Pawel
if I change this line and wrote:
TIdAttachmentFile *File = new 
TIdAttachmentFile(IdMessage1->MessageParts,"test.txt");
error is:
[BCC32 Error] UObsluga.cpp(617): E2451 Undefined symbol 'TIdAttachmentFile'

any concepts? :/ 
Re: TIdAttachmentFile generate: Type name expected
#748
Author: Ted Lyngmo
Date: Mon, 01 Oct 2007 21:15
16 lines
1682 bytes
Remy Lebeau (TeamB) wrote:
> "Pawe� Kurzawa" <pkurzawa@izissoft.pl> wrote in message
>
>>[BCC32 Error] UObsluga.cpp(614): E2303 Type name expected
> 
> You likely did not include IdAttachmentFile.hpp into your code:
> 
>     #include "IdAttachmentFile.hpp"

One simple way to avoid problems like that is to drop a component, of 
the same type that you are allocating dynamically, on your form. You 
then get all the includes you need. Just copy the include lines and then 
remove the VCL and then paste them back in again.

Best regards,
Ted Lyngmo
Re: TIdAttachmentFile generate: Type name expected
#749
Author: Pawel Kurzawa
Date: Mon, 01 Oct 2007 22:04
24 lines
1908 bytes
Uzytkownik "Ted Lyngmo" <tedREMOVETHIS@lyncon.se> napisal w wiadomosci 
news:47016355$1@newsgroups.borland.com...
> Remy Lebeau (TeamB) wrote:
>> "Pawe� Kurzawa" <pkurzawa@izissoft.pl> wrote in message
>>
>>>[BCC32 Error] UObsluga.cpp(614): E2303 Type name expected
>>
>> You likely did not include IdAttachmentFile.hpp into your code:
>>
>>     #include "IdAttachmentFile.hpp"
>
> One simple way to avoid problems like that is to drop a component, of the 
> same type that you are allocating dynamically, on your form. You then get 
> all the includes you need. Just copy the include lines and then remove the 
> VCL and then paste them back in again.
>
> Best regards,
> Ted Lyngmo

Thanks a lot, now all its very good :D

Best regards
Pawel 
Re: TIdAttachmentFile generate: Type name expected
#750
Author: Pawel Kurzawa
Date: Mon, 01 Oct 2007 22:04
19 lines
1840 bytes
Uzytkownik "Ted Lyngmo" <tedREMOVETHIS@lyncon.se> napisal w wiadomosci 
news:47016355$1@newsgroups.borland.com...
> Remy Lebeau (TeamB) wrote:
>> "Pawe� Kurzawa" <pkurzawa@izissoft.pl> wrote in message
>>
>>>[BCC32 Error] UObsluga.cpp(614): E2303 Type name expected
>>
>> You likely did not include IdAttachmentFile.hpp into your code:
>>
>>     #include "IdAttachmentFile.hpp"
>
> One simple way to avoid problems like that is to drop a component, of the 
> same type that you are allocating dynamically, on your form. You then get 
> all the includes you need. Just copy the include lines and then remove the 
> VCL and then paste them back in again.
>
> Best regards,
> Ted Lyngmo
Re: TIdAttachmentFile generate: Type name expected
#751
Author: Remy Lebeau (TeamB)
Date: Tue, 02 Oct 2007 16:37
15 lines
1616 bytes
"Ted Lyngmo" <tedREMOVETHIS@lyncon.se> wrote in message
news:47016355$1@newsgroups.borland.com...

> One simple way to avoid problems like that is to drop a component,
> of the same type that you are allocating dynamically, on your form.

That will not work in this case.  TIdAttachmentFile is not a component of
its own, and no other classes are declared in IdAttachmentFile.hpp.  So it
has to be included manually.  And no other units use the IdAttachmentFile
unit directly, so it cannot be auto-included for you from other components,
either.


Gambit
Re: TIdAttachmentFile generate: Type name expected
#752
Author: Remy Lebeau (TeamB)
Date: Tue, 02 Oct 2007 16:38
13 lines
1244 bytes
"Pawe� Kurzawa" <pkurzawa@izissoft.pl> wrote in message
news:47015795@newsgroups.borland.com...

> [BCC32 Error] UObsluga.cpp(617): E2451 Undefined symbol
'TIdAttachmentFile'
>
> any concepts? :/

You already know the answer to that.


Gambit
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads