I am seeing a lot of bizarre behaviour in D3 with one particular project
with the Application.CreateForm statements in project source.
1. It will not allow there to be no CreateForm calls in the project source.
2. The statements found here do not match the settings shown in Project |
Options | Forms
Right now I am looking at this project source
program DBRepair;
uses
Forms,
Errtbdlg in
'..\..\..\..\Software\Delphi\TUtility\O2A\Delphi2-3\tu32\TU\Demos\BtchProj\E
RRTBDLG.PAS' {BtnBottomDlg},
License in 'License.pas' {LicenseForm};
{$R *.RES}
begin
Application.CreateForm(TBtnBottomDlg, BtnBottomDlg);
Application.CreateForm(TLicenseForm, LicenseForm);
Application.Run;
end.
And the Project | Forms dialog looks like:
Main form: LicenseForm
Autocreate forms: LicenseForm
Available forms: BtnBottomDlg
The problems are obvious enough:
a. Both forms should be in the autocreate list.
b. The main form being LicenseForm, this should appear first in the
Application.CreateForm statements.
c. The form that is appearing first on the screen at runtime (and closes the
application when closed) is, you guessed it, BtnBottomDlg.
d. if I now tell Delphi that BtnBottomDlg is supposed to be in the list of
autocreated forms then it will add a second CreateForm statement for
TBtnBottomDlg to the one that is already there.
So my project source now looks like this:
Application.CreateForm(TBtnBottomDlg, BtnBottomDlg);
Application.CreateForm(TLicenseForm, LicenseForm);
Application.CreateForm(TBtnBottomDlg, BtnBottomDlg);
And Delphi still insists that TLicenseForm is the main form. If I move
TLicenseForm to the top of the list, Delphi now insists that two
BtnBottomDlgs will be auto-created and LicenseForm is now in the list of
available forms. It seems the only way that will work is
Application.CreateForm(TLicenseForm, LicenseForm);
Application.CreateForm(TLicenseForm, LicenseForm);
Application.CreateForm(TBtnBottomDlg, BtnBottomDlg);
This is stupid. I don't remember this from Delphi 2.
============================================
Patrick Dunford, Christchurch, NZ
http://patrick.dunford.com/
http://www.trainweb.org/enzedrail/
----------------------------------------------------------------------------
----------
Visit the Canterbury Railway Society Website
http://www.trainweb.org/canterbury/
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz