Kanade's Delphi Stuff
Delphi Tips, Sample code and Tools
Copyright © 1997-2004, Sanjay Kanade
 
  Tips and Tricks on Delphi
Please read the DISCLAIMER before you use any of the tips from this web site. Go to main index
  Delphi Tips: C++ Builder tips
Tip 57:  Don't use FormCreate initialization for members
(modified: 17 Apr 2002)


  57: Don't use FormCreate initialization for members
Date added/modified: 17 Apr 2002

Although I prefer to use Delphi for all my products, sometimes I need to use C++ Builder for developing products for others. There is one major problem in C++ Builder, especially if you are coming from Delphi background.

In Delphi, one is used to initialize member variables of a form in FormCreate. Don't do that in C++ Builder. Instead, do that in the constructor for the form. The reason is that in C++ Builder, the FormCreate gets control first and then the constructor code is called. This causes problem with AnsiString variables. These lose values set in FormCreate.



 

Copyright 1995-2004, Sanjay Kanade. All rights reserved.
All trademarks and copyrights belong to their respective owners.