Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Constructor vs OnCreate 1

Status
Not open for further replies.

imagenetics

Programmer
Dec 8, 2003
66
PL
This may sound stupid but what is the difference between, assingning a value to a variable or calling a function in form's constructor and in OnCreate?
 

Use OnCreate to perform special processing when the form is created and is invoked by TCustomForm’s constructor. Either implement this event or override the constructor of the form; do not do both. Any objects created in the OnCreate event should be freed by the OnDestroy event.

When a form is being created and its Visible property is true, the following events occur in the order listed:

1. OnCreate
2. OnShow
3. OnActivate
4. OnPaint

Note: Use of the OnCreate event is discouraged in C++Builder because it can interact badly with the form’s constructor. It is recommended that you override the form constructor instead.

I copied from the C++Builder help. I think is a good explanation

--- LastCyborg ---
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top