Board index » delphi » Help with a GPF

Help with a GPF

I have an app with two forms.

MainForm     a MDIform and
DatabaseForm a MDIchild

The Databaseform contains a listbox (DatabaseListBox)

The MainForm FormCreate conains the following code ...

{ FormCreate is called when the form is created }
procedure TMainForm.FormCreate(Sender: TObject);
begin
  Session.GetDatabaseNames(DatabaseForm.DatabaseListBox.Items);
end;

The app compiles and links OK, BUT when I go to run it
I get a GPF of 0001:03A3 at ...

  Session.GetDatabaseNames(DatabaseForm.DatabaseListBox.Items);

Can any one help me.

Regards from Ian.
--
                     ||||||||
                     | ~  ~ |
                    (| @  @ |)
----------------oOOo---(__)---oOOo------------------------
| Ian - "Smoke me a kipper I'll be back for breakfast !" |
|                                                        |
| EMail IanMa...@breallon.demon.co.uk    Banco Real s.a. |
|                                        (London Branch) |
----------------------------------------------------------

 

Re:Help with a GPF


"Ian A. Macey" <IanMa...@breallon.demon.co.uk> wrote:

Quote
>I have an app with two forms.

>MainForm     a MDIform and
>DatabaseForm a MDIchild

>The Databaseform contains a listbox (DatabaseListBox)

>The MainForm FormCreate conains the following code ...

>{ FormCreate is called when the form is created }
>procedure TMainForm.FormCreate(Sender: TObject);
>begin
>  Session.GetDatabaseNames(DatabaseForm.DatabaseListBox.Items);
>end;

>The app compiles and links OK, BUT when I go to run it
>I get a GPF of 0001:03A3 at ...

>  Session.GetDatabaseNames(DatabaseForm.DatabaseListBox.Items);

>Can any one help me.

>Regards from Ian.
>--
>                     ||||||||
>                     | ~  ~ |
>                    (| @  @ |)
>----------------oOOo---(__)---oOOo------------------------
>| Ian - "Smoke me a kipper I'll be back for breakfast !" |
>|                                                        |
>| EMail IanMa...@breallon.demon.co.uk    Banco Real s.a. |
>|                                        (London Branch) |
>----------------------------------------------------------

         Hi Ian!

I had a similar GPF once. It seems that your
"Session.GetDatabaseNames(DatabaseForm.DatabaseListBox.Items)"
accesses the Form "databaseform" BEFORE ITS METHOD FORMCREATE
HAS BEEN CALLED.

Put a breakpoint in databaseform.formcreate and in
mainform.formcreate. If the de{*word*81} stops in
mainform.formcreate first, Im right.

Look in your Project file and youll see that
mainform.formcreate is called before databaseform.formcreate.
Remove the line "application.createform(databaseform)" and
insert it into Method mainform.formcreate instead.

Hope this helps you,

Arthur Hoornweg

Other Threads