The consensus is that you should never depend on this flag, and thus never use
OnCreate or OnDestroy. Use the constructor / destructor instead.
That being said, Turbopower has a free utility to fix this for you. Check out
http://www.turbopower.com
+====================================================+
| Jonathan Arnold (mailto:jdar...@buddydog.org) |
| Havas Interactive HyperStudio Engineer |
| http://www.buddydog.org http://www.hyperstudio.com |
+====================================================+
To his dog, every man is Napoleon; hence the constant
popularity of dogs. -- Aldous Huxley
Are you by chance using form inheritance and the object repository? If so, simply
changing OldCreateOrder to false is not enough. It manages to become true again,
somehow. (due to a bug IMO).
Add this code to the base forms in the repository. This should squash the
OldCreateOrder problem for forms that are inherited. The following is a copy of
something I posted a long time ago.
<quote>
5- If you work with a large group of programmers, it may be difficult convincing all
of them to give up OnCreate and OnShow. What happens when you go on vacation, or when
you move on to the next high paying job? Who's going to baby sit when you are not
around? I suggest that you add a method to forms that you put in the object
repository. Override the methods that stream in the properties for the form, and
hardcode OldCreateOrder to false.
void __fastcall TBaseForm::ReadState(TReader* Reader)
{
OldCreateOrder = false;
TForm::ReadState(Reader);
OldCreateOrder = false;
}
That first assignment may not be necessary. I took an aggressive stance against the
property.
Someone else suggested the same thing, but they set the property from Loaded. I don't
know if it matters. I don't remember why I chose ReadState. Maybe it causes the
Object inspector to display false like it should? Maybe not. TCustomForm::ReadState
is where a lot of this trouble starts.
I ended up using this strategy mostly because of OnShow problems, and not OnCreate.
</quote>
In this example, TBaseForm is a base class form in the object repository.
Harold Howe [TeamB]
http://www.bcbdev.com
Use the constructors and destructors instead :-))
--
Martin Hart
-----------------
mar...@memorysoft.es
www.memorysoft.es
"Jonathan Arnold" <jdar...@buddydog.org> escribió en el mensaje
news:39477D63...@buddydog.org...