Author |
|
rafaellop Newbie
Joined: 13 September 2007
Online Status: Offline Posts: 26
|
Posted: 21 February 2008 at 6:46am | IP Logged
|
|
|
Hello again :)
Unfortunately I've again found something I cannot handle only by myself.
The problem is that even with EnableEvents set to false, the POP3 Client events are fired.
However it's not a normal use of the component... I want events only for messages that are bigger than 200 kb. So that before I retrieve a message I check its size and enable or disable events using the EnableEvents property. If a message size is bigger than my limit I set EnableEvents to true. If the size is smaller, I set it to false. The method is for a progress window that should be visible only for big messages.
Code:
if msgsize > 200000 then
begin
showev := true;
FNewPOP3Client.EnableEvents := true;
end
else
begin
showev := false;
FNewPOP3Client.EnableEvents := false;
end;
RetrievedMessage := FNewPOP3Client.RetrieveSingleMessage(msgid);
if showev then
FNewPOP3Client.EnableEvents := false;
|
|
|
Could you please check this for me ?
Cheers,
Rafal
|
Back to Top |
|
|
Alex AfterLogic Support
Joined: 19 November 2003
Online Status: Offline Posts: 2206
|
Posted: 21 February 2008 at 6:59am | IP Logged
|
|
|
EnableEvents property won't change its value if you're already connected to the server. This is because EnableEvents controls what type of Windows socket to create. Once Windows socket is created, its type cannot be changed.
Thus, events should always be fired in your app but you can maintain another boolean variable (e.g. blnLargeMessage), set it for large emails to True and check it in your event handler: if it's False, leave the handler immediately.
Regards,
Alex
|
Back to Top |
|
|
rafaellop Newbie
Joined: 13 September 2007
Online Status: Offline Posts: 26
|
Posted: 21 February 2008 at 7:24am | IP Logged
|
|
|
Ok, but in the documentation you write that EnableEvents is initially set to false because of the performance issues. It's critical for me to have as high performance as possible. Would you confirm that checking the condition inside event handler will have similar performance as EnableEvents = false?
Cheers
Rafal
|
Back to Top |
|
|
Alex AfterLogic Support
Joined: 19 November 2003
Online Status: Offline Posts: 2206
|
Posted: 21 February 2008 at 7:34am | IP Logged
|
|
|
Well, performance loss due to EnableEvents set to True can be ignored. It's very-very small.
Regards,
Alex
|
Back to Top |
|
|