Subj : EStack overflow during form initialisation To : borland.public.cpp.borlandcpp From : PBH Date : Fri Aug 06 2004 04:14 pm Hi, I have a small application in BCB6.0 version and the application has two forms. One with default constructor and the other with extra patameter as below. As soon as I run the application it gets into a recursive loop during form initialisation and I get stack overflow. Any one knows why? I have to have extra parameter in the TForm2 for my application to work. How do I do that? thanks, PBH //***************unit1.h**************** //-------------------------------------------------------------------------- - class TForm1 : public TForm { __published: // IDE-managed Components TEdit *Edit1; private: // User declarations public: // User declarations __fastcall TForm1(TComponent* Owner); TForm2 *Form2; }; //-------------------------------------------------------------------------- - extern PACKAGE TForm1 *Form1; //***************unit1.cpp**************** TForm1 *Form1; //-------------------------------------------------------------------------- - __fastcall TForm1::TForm1(TComponent* Owner) : TForm(Owner) { } //*************unit2.h********************** //-------------------------------------------------------------------------- - class TForm2 : public TForm { __published: // IDE-managed Components TButton *Button1; private: // User declarations public: // User declarations __fastcall TForm2(TComponent* Owner,int i); }; //-------------------------------------------------------------------------- - extern PACKAGE TForm2 *Form2; //***********unit2.cpp************************ TForm2 *Form2; //-------------------------------------------------------------------------- - __fastcall TForm2::TForm2(TComponent* Owner,int i) : TForm(Owner) { } .