O/H Wilson, Stephen έγραψε:

> then Release. So, I think you are right iin recommending OnClose + 
> caFree, Dave and I will follow that in my app, but I don't understand 
> the Delphi Help on TCustomForm.Release - "Any event handlers of the form 
> should use Release instead of Free".

TForm's Release() method _posts_ a CM_RELEASE windows message
to itself. And because the message is posted (instead of sent)
goes to the end of the message queue of that form. That means
that this message it's going to be the last message the form
processes.

Release() uses the PostMessage() to post that message. So
Release() returns immediately. If SendMessage() was used
by the Release() it wouldn't return until the message
is processed, since SendMessage() sends the message
directly to the window procedure of the form.
It's the asynchronous versus synchronous execution.

And there is a specific message handler method for that
CM_RELEASE message which just calls Free().

procedure TCustomForm.CMRelease;
begin
   Free;
end;

So _that_ Free(), the Release() ends up to call,
is the last method called by the form.


-- 
Regards
Theo

------------------------
Theo Bebekis
Thessaloniki, Greece
------------------------
Greek_Delphi_Prog : a Delphi Programming mailing list in Greek at
    http://groups.yahoo.com/group/Greek_Delphi_Prog

CSharpDotNetGreek : A C# and .Net mailing list in Greek language at
    http://groups.yahoo.com/group/CSharpDotNetGreek

atla_custom : a Unisoft Atlantis Customization mailing list at
    http://groups.yahoo.com/group/atla_custom
------------------------

------------------------------------

-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: [EMAIL PROTECTED] Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/delphi-en/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/delphi-en/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[EMAIL PROTECTED] 
    mailto:[EMAIL PROTECTED]

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

Reply via email to