🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.internet.socket
13 messages
13 total messages Started by JLoz Thu, 21 Jun 2007 00:07
Assertion Failure when sending email with attachment
#1082
Author: JLoz
Date: Thu, 21 Jun 2007 00:07
24 lines
1800 bytes
I am trying to send an email with Indy 10 and I get an assertion error. 
This is the part of the  code where I attach the file.

TIdAttachmentFile * File = new 
TIdAttachmentFile(IdMessage1->MessageParts,"test.txt");
IdSMTP1->Connect();
IdSMTP1->Send(IdMessage1);

if I delete File then the email gets sent but no attachement is received.

The error message I get is

EAssertion Failed with 'Assertion Failure IdGloba.pas Line 2528'

The way the attachments are sent is different from what I was accostumed to 
do with Indy 9, and I had problems trying to use IdAttachementFile as it was 
not being recognized.  I had to include the IdAttachementFile.hpp and I got 
it to compile, but I have not been able to send any attachments.

What am I doing wrong?

Thanks,

JLoz 
Re: Assertion Failure when sending email with attachment
#1083
Author: Remy Lebeau (TeamB)
Date: Thu, 21 Jun 2007 04:10
36 lines
2488 bytes
"JLoz" <jfsierra@excite.com> wrote in message
news:4679c15b$2@newsgroups.borland.com...

> The error message I get is
>
> EAssertion Failed with 'Assertion Failure IdGloba.pas Line 2528'

It would be helpful if you would show what is actually on that line.
There have been so many releases and snapshots of Indy, there is no
way to know which one you are actually using.  For instance, there is
no assertion on that line in my copy of IdGlobal.pas.  Line 2528 is
inside the TIdLocalEvent constructor.

> The way the attachments are sent is different from what I was
> accostumed to do with Indy 9

Attachments work the same as they did in Indy 9.  The only difference
is that Indy 9 supported only file attachments whereas Indy 10
supports a customizable attachment model.  So the TIdAttachment class
is now an abstract base class in Indy 10 and can't be instantiated
directly anymore.  TIdAttachmentFile in Indy 10 is the direct
replacement for TIdAttachment in Indy 9.  Most of your code that used
TIdAttachment in Indy 9 does not need to change in Indy 10, as the
methods/properties are the same.  The only real change you need to
when you instantiate a new attachment, which you already updated that
code.

> I had problems trying to use IdAttachementFile as it was not being
recognized.

Then you did not read the documentation, as it tells you which unit
each class/component is declared in.


Gambit
Re: Assertion Failure when sending email with attachment
#986
Author: JLoz
Date: Thu, 21 Jun 2007 12:13
57 lines
3003 bytes
Here are the lines:

2526:   function IndyLength(const ABuffer: String; const ALength: Integer 
= -1; const AIndex: Integer = 1): Integer;
2527:   begin
2528:     Assert(AIndex >= 1);
2529:     if ALength < 0 then begin
2530:       Result := Length(ABuffer)-AIndex+1;
2531:     end else begin
2532:       Result := Min(Length(ABuffer)-AIndex+1, ALength);
2533:     end;
2534:   end;


Thanks again,


"Remy Lebeau (TeamB)" <no.spam@no.spam.com> wrote in message 
news:4679fa58$1@newsgroups.borland.com...
>
> "JLoz" <jfsierra@excite.com> wrote in message
> news:4679c15b$2@newsgroups.borland.com...
>
>> The error message I get is
>>
>> EAssertion Failed with 'Assertion Failure IdGloba.pas Line 2528'
>
> It would be helpful if you would show what is actually on that line.
> There have been so many releases and snapshots of Indy, there is no
> way to know which one you are actually using.  For instance, there is
> no assertion on that line in my copy of IdGlobal.pas.  Line 2528 is
> inside the TIdLocalEvent constructor.
>
>> The way the attachments are sent is different from what I was
>> accostumed to do with Indy 9
>
> Attachments work the same as they did in Indy 9.  The only difference
> is that Indy 9 supported only file attachments whereas Indy 10
> supports a customizable attachment model.  So the TIdAttachment class
> is now an abstract base class in Indy 10 and can't be instantiated
> directly anymore.  TIdAttachmentFile in Indy 10 is the direct
> replacement for TIdAttachment in Indy 9.  Most of your code that used
> TIdAttachment in Indy 9 does not need to change in Indy 10, as the
> methods/properties are the same.  The only real change you need to
> when you instantiate a new attachment, which you already updated that
> code.
>
>> I had problems trying to use IdAttachementFile as it was not being
> recognized.
>
> Then you did not read the documentation, as it tells you which unit
> each class/component is declared in.
>
>
> Gambit
>
> 
Re: Assertion Failure when sending email with attachment
#987
Author: JLoz
Date: Thu, 21 Jun 2007 13:50
55 lines
2951 bytes
Gambit,

According to your answer I already changed the code in in theory it should 
work, right?

I tried entering a wrong path and I get an EFOpenError with message 'Cannot 
open file xxx'.  That tells me its trying to open the file.  When the path 
is correct the assertion error occurs in the line

IdSMTP1->Sent(IdMessage1)

Thanks in advance for your help.

JLoz

"Remy Lebeau (TeamB)" <no.spam@no.spam.com> wrote in message 
news:4679fa58$1@newsgroups.borland.com...
>
> "JLoz" <jfsierra@excite.com> wrote in message
> news:4679c15b$2@newsgroups.borland.com...
>
>> The error message I get is
>>
>> EAssertion Failed with 'Assertion Failure IdGloba.pas Line 2528'
>
> It would be helpful if you would show what is actually on that line.
> There have been so many releases and snapshots of Indy, there is no
> way to know which one you are actually using.  For instance, there is
> no assertion on that line in my copy of IdGlobal.pas.  Line 2528 is
> inside the TIdLocalEvent constructor.
>
>> The way the attachments are sent is different from what I was
>> accostumed to do with Indy 9
>
> Attachments work the same as they did in Indy 9.  The only difference
> is that Indy 9 supported only file attachments whereas Indy 10
> supports a customizable attachment model.  So the TIdAttachment class
> is now an abstract base class in Indy 10 and can't be instantiated
> directly anymore.  TIdAttachmentFile in Indy 10 is the direct
> replacement for TIdAttachment in Indy 9.  Most of your code that used
> TIdAttachment in Indy 9 does not need to change in Indy 10, as the
> methods/properties are the same.  The only real change you need to
> when you instantiate a new attachment, which you already updated that
> code.
>
>> I had problems trying to use IdAttachementFile as it was not being
> recognized.
>
> Then you did not read the documentation, as it tells you which unit
> each class/component is declared in.
>
>
> Gambit
>
> 
Re: Assertion Failure when sending email with attachment
#988
Author: Remy Lebeau (TeamB)
Date: Thu, 21 Jun 2007 17:10
13 lines
1331 bytes
"JLoz" <jfsierra@excite.com> wrote in message
news:467a6b66$1@newsgroups.borland.com...

> Here are the lines:

According to that, an AIndex of 0 or lower is being passed to the
function.  That should never happen.  Then again, IndyLength() is used
in a lot of places, so it would be useful if you could track down
further which specific call is the faulty one.


Gambit
Re: Assertion Failure when sending email with attachment
#989
Author: Remy Lebeau (TeamB)
Date: Thu, 21 Jun 2007 17:10
14 lines
1363 bytes
"JLoz" <jfsierra@excite.com> wrote in message
news:467a8244@newsgroups.borland.com...

> I tried entering a wrong path and I get an EFOpenError with
> message 'Cannot open file xxx'.  That tells me its trying to open
the file.

That is what it is supposed to do.  You are trying to send a message
with a file attachment, so the file has to be opened so its data can
be encoded for transmission.


Gambit
Re: Assertion Failure when sending email with attachment
#990
Author: JLoz
Date: Thu, 21 Jun 2007 17:28
28 lines
1919 bytes
Thanks for the suggestion.  However, I am not exactly sure how I could track 
down the faulty call since I would not be able to step into any pascal unit. 
I tried going into the IdAttachmentFile.pas file and see the constructor but 
it is not clear to me where it goes.

I would be glad to do the work, but could you please give me some tips?

Thanks again,

JLoz

"Remy Lebeau (TeamB)" <no.spam@no.spam.com> wrote in message 
news:467ab2f7$1@newsgroups.borland.com...
>
> "JLoz" <jfsierra@excite.com> wrote in message
> news:467a6b66$1@newsgroups.borland.com...
>
>> Here are the lines:
>
> According to that, an AIndex of 0 or lower is being passed to the
> function.  That should never happen.  Then again, IndyLength() is used
> in a lot of places, so it would be useful if you could track down
> further which specific call is the faulty one.
>
>
> Gambit
>
> 
Re: Assertion Failure when sending email with attachment
#991
Author: Remy Lebeau (TeamB)
Date: Thu, 21 Jun 2007 17:55
18 lines
1571 bytes
"JLoz" <jfsierra@excite.com> wrote in message
news:467ab52b@newsgroups.borland.com...

> Thanks for the suggestion.  However, I am not exactly sure how
> I could track down the faulty call since I would not be able to
> step into any pascal unit.

You could recompile Indy with debug enabled.  Then you could step
through it.

> I tried going into the IdAttachmentFile.pas file and see the
> constructor but it is not clear to me where it goes.

This is not a constructor issue.


Gambit
Re: Assertion Failure when sending email with attachment
#992
Author: JLoz
Date: Thu, 21 Jun 2007 18:31
55 lines
3315 bytes
Thanks again.

The problem is that I never got it to compile with the debug as the Zlib.pas 
file makes the compiler crash and the only way I got it to work was to 
disable debug (this by creating the bpk files manually using the IDE).

If you could help me determine why the following lines fail in the 
FULLC5.bat file that I got by modifying FULLC6.bat, I would probably be able 
to make it work and probably send the new FULLC5.bat to share with other 
people.  I am using the latest snapshot by the way (Version 10.1.6 I think)

dcc32.exe IndyProtocols50.dpk /O..\Lib\Protocols\objs /DBCB /M /H /W /JPHN 
/N. /U. -$d-l-n+p+r-s-t-w-y- %2 %3 %4

dcc32.exe IndyProtocols50.dpk /O..\Lib\Protocols\objs /DBCB /M /H /W /N. 
/U. -$d-l-n+p+r-s-t-w-y- %2 %3 %4

The first line fails and then by ignoring the error I get the other one to 
run and it seems to work.  However, since I am not familiar with the command 
line parameters for dcc32.exe I am not exactly sure the differences.

You might remember my previous post where I had compiler errors due to some 
structures in the API header that are not available for BCB5.  Well, I 
commented out those lines in Winsock2.hpp and gave it a try since I do not 
have any choice being stated that Indy10 will probably not be tested in BCB5 
in a long time, if at all.

If at least I could compile it without issues it would be great.

Thanks for your patience,

JLoz

"Remy Lebeau (TeamB)" <no.spam@no.spam.com> wrote in message 
news:467abdaf@newsgroups.borland.com...
>
> "JLoz" <jfsierra@excite.com> wrote in message
> news:467ab52b@newsgroups.borland.com...
>
>> Thanks for the suggestion.  However, I am not exactly sure how
>> I could track down the faulty call since I would not be able to
>> step into any pascal unit.
>
> You could recompile Indy with debug enabled.  Then you could step
> through it.
>
>> I tried going into the IdAttachmentFile.pas file and see the
>> constructor but it is not clear to me where it goes.
>
> This is not a constructor issue.
>
>
> Gambit
>
> 
Re: Assertion Failure when sending email with attachment
#999
Author: Bob Gonder
Date: Fri, 22 Jun 2007 16:31
13 lines
1881 bytes
JLoz wrote:

>You might remember my previous post where I had compiler errors due to some 
>structures in the API header that are not available for BCB5.  Well, I 
>commented out those lines in Winsock2.hpp and gave it a try since I do not 
>have any choice being stated that Indy10 will probably not be tested in BCB5 
>in a long time, if at all.

That is not the usual method to use in the case of missing
definitions.  The proper thing to do is research the missing
definitions and add them.
Here's one one the missing structures.
http://msdn2.microsoft.com/en-us/library/ms740504.aspx
Re: Assertion Failure when sending email with attachment
#1000
Author: JLoz
Date: Fri, 22 Jun 2007 17:01
24 lines
2160 bytes
Thanks!

In BCB5, which header file should I add this to?

JLoz
"Bob Gonder" <notbg@notmindspring.invalid> wrote in message 
news:t1un73t3iuqf0l49rnj9075f4i0f7cc199@4ax.com...
> JLoz wrote:
>
>>You might remember my previous post where I had compiler errors due to 
>>some
>>structures in the API header that are not available for BCB5.  Well, I
>>commented out those lines in Winsock2.hpp and gave it a try since I do not
>>have any choice being stated that Indy10 will probably not be tested in 
>>BCB5
>>in a long time, if at all.
>
> That is not the usual method to use in the case of missing
> definitions.  The proper thing to do is research the missing
> definitions and add them.
> Here's one one the missing structures.
> http://msdn2.microsoft.com/en-us/library/ms740504.aspx
>
> 
Re: Assertion Failure when sending email with attachment
#1003
Author: Bob Gonder
Date: Fri, 22 Jun 2007 17:23
13 lines
1573 bytes
JLoz wrote:

>In BCB5, which header file should I add this to?

At the bottom of the page it tells you where it is normaly found.

Or you could just put them in idmissing.h and add that to the Indy
modules that complain.

// regular headers first, then
#ifndef SOCKADDR_STORAGE
#include	<idmissing.h>
#endif
Re: Assertion Failure when sending email with attachment
#1007
Author: JLoz
Date: Fri, 22 Jun 2007 18:15
34 lines
2343 bytes
Thanks a lot!

I will take care of this.

JLoz
"JLoz" <jfsierra@excite.com> wrote in message 
news:467c0073$1@newsgroups.borland.com...
> Thanks!
>
> In BCB5, which header file should I add this to?
>
> JLoz
> "Bob Gonder" <notbg@notmindspring.invalid> wrote in message 
> news:t1un73t3iuqf0l49rnj9075f4i0f7cc199@4ax.com...
>> JLoz wrote:
>>
>>>You might remember my previous post where I had compiler errors due to 
>>>some
>>>structures in the API header that are not available for BCB5.  Well, I
>>>commented out those lines in Winsock2.hpp and gave it a try since I do 
>>>not
>>>have any choice being stated that Indy10 will probably not be tested in 
>>>BCB5
>>>in a long time, if at all.
>>
>> That is not the usual method to use in the case of missing
>> definitions.  The proper thing to do is research the missing
>> definitions and add them.
>> Here's one one the missing structures.
>> http://msdn2.microsoft.com/en-us/library/ms740504.aspx
>>
>>
>
> 
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