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

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

By default at start-up this is:
//---------------------------------------------------------------------------
  1. ifndef Unit1H
  2. define Unit1H
//---------------------------------------------------------------------------
  1. include <Classes.hpp>
  2. include <Controls.hpp>
  3. include <StdCtrls.hpp>
  4. include <Forms.hpp>
//--------------------------------------------------------------------------- class TForm1 : public TForm { __published: // IDE-managed Components private: // User declarations public: // User declarations __fastcall TForm1(TComponent* Owner); }; //--------------------------------------------------------------------------- extern PACKAGE TForm1 *Form1; //---------------------------------------------------------------------------
  1. endif


The first thing you can notice is the use an #include guard:
  1. ifndef Unit1H
  2. define Unit1H
//Rest of code
  1. endif
After it, some usefull header files are #included.

Then the class TForm1 is declared, which inherits publicly from TForm:
class TForm1 : public TForm


The class's internals have __published, private and public access rights. The __published section is managed by C++ Builder itself. Don't touch, unless you know what you're doing. The other sections can have functions and variables added. There already is one function declared: the constructor of TForm1:

__published:	// IDE-managed Components
private:	// User declarations
public:		// User declarations
  __fastcall TForm1(TComponent* Owner); //Constructor


The last unknown line declares a global pointer to TForm1 called Form1. It is extern, so it can be used in multiple Units.
extern PACKAGE TForm1 *Form1;


last edited (June 22, 2006) by bilderbikkel, Number of views: 1807, Current Rev: 3 (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.