RAD Studio
ContentsIndex
PreviousUpNext
Controlling When Forms Reside in Memory

By default, Delphi automatically creates the application's main form in memory by including the following code in the application's main entry point:

Application.CreateForm(TForm1, Form1);

 

Application ->CreateForm(__classid(TForm1), &Form1);

This function creates a global variable with the same name as the form. So, every form in an application has an associated global variable. This variable is a pointer to an instance of the form's class and is used to reference the form while the application is running. Any unit that includes the form's unit in its uses clause can access the form via this variable. 

All forms created in this way in the project unit appear when the program is invoked and exist in memory for the duration of the application.

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!