[Home]  [Edit this page]  [Recent Changes]  [Special Pages]  [Help
CppBuilderVclUnit1CPP

(C++ Builder) Unit1.cpp (VCL)

Its default start-up code is:
//---------------------------------------------------------------------------
  1. include <vcl.h>
  2. pragma hdrstop
  1. include "Unit1.h"
//---------------------------------------------------------------------------
  1. pragma package(smart_init)
  2. pragma resource "*.dfm"
TForm1 *Form1; //--------------------------------------------------------------------------- __fastcall TForm1::TForm1(TComponent* Owner) : TForm(Owner) { } //---------------------------------------------------------------------------


First, the VCL is #included, later its header file Unit1.h.

The line below defines the pointer called Form1, an instance of TForm1:
TForm1 *Form1;


The most difficult-looking line below, is the constructor of TForm1:
__fastcall TForm1::TForm1(TComponent* Owner)
  : TForm(Owner)
{
}
All VCL objects needs to be constructed with an Owner, so does TForm1. After the colon : it is initialized with its Owner.



last edited (November 11, 2006) by bilderbikkel, Number of views: 1621, Current Rev: 4 (Diff)

[Edit this page]  [Page history]  [What links here]  [Discuss this topic]  [Printer Friendly]  

Members

Username:

Password:


Register
Forgot Password?




Programmers Heaven - for .NET, Java, C/C++ and WEB Developers!
© 1996-2008 Community Networks Ltd. All rights reserved. Reproduction in whole or in part, in any form or medium without express written permission is prohibited. Violators of this policy may be subject to legal action. Please read Terms Of Use and Privacy Statement for more information. Development by Tore Nestenius at .NET Consultant - Synchron Data.