Board index » cppbuilder » Why? Re: code bug created after migrating from bcb 3.0 to 6.0

Why? Re: code bug created after migrating from bcb 3.0 to 6.0


2003-10-08 06:02:05 AM
cppbuilder7
that is exactly my problem..., but why does it still work for the integers? I am not familiar with using the constructors, where do I put my initializing code?
thanks again,
Joel
"Remy Lebeau \(TeamB\)" < XXXX@XXXXX.COM >wrote:
Quote

"joel Guerra" < XXXX@XXXXX.COM >wrote in message
news:3f833016$ XXXX@XXXXX.COM ...

>After migrating, I noticed that the AnsiString get Null'd out after the
form create section....

Are you referring to the OnCreate event? If so, then you should not be
using that event at all. It has been broken since BCB 4. It executes
before the constructor, which is illegal in C++. Use the contructor instead
for any initializations that you need to do.


Gambit


 
 

Re:Why? Re: code bug created after migrating from bcb 3.0 to 6.0

"joel guerra" < XXXX@XXXXX.COM >wrote in message
Quote
that is exactly my problem..., but why does it still work for the
integers?
Blind luck.
Quote
I am not familiar with using the constructors, where do I put my
initializing code?
Everytime you create a new form class, a constructor is already provided for
you as part of the default generated code. That is the method that is named
the same as the class name, and takes a TCompoent parameter, ie:
__fastcall TForm1::TForm1(TComponent *Owner)
: TForm(Owner)
{
// your initialization code goes here
}
Gambit