Board index » delphi » "Creating forms" reviseted

"Creating forms" reviseted

Quote
> Thanks for your reply. I'mn not sure I know all the answers. Here is the
> source code:

> begin
>   Application.Initialize;
>   Application.CreateForm(TfrmMain2, frmMain2);
>   Application.Run;
> end.
>     I think it goes wild in the CreateForm statement. It takes a few
seconds
> to lock up, so it appears that the Run statement is the culprit, but if I
> step through it and just wait after the CreateForm statement, it will lock
> up.

I'm sure it's the CreateForm statement.
What I was asking is the code in the OnCreate-event in the mainform. That's
the code in the procedure TFrmMain2.Create(Sender: TObject).
Can you put a breakpoint on the begin-statement in that procedure and step
throug it (press F7 to run the next row). Now you can  find the line where
the problem occurs.
BTW, can you load the form in Delphi without running the app?

To let others learn from this discussion, let's follow up in the NG.

Alfred.

 

Re:"Creating forms" reviseted


There is no code in the "OnCreate" event handler. I put all the
initialization code in the "OnActivate" handler.
    Lloyd
"Alfred ten Hoeve" <Alfred.NoS...@SimpelProg.nl> wrote in message
news:3d2a3f6a$0$222$4d4ebb8e@news.nl.uu.net...
Quote
> > Thanks for your reply. I'mn not sure I know all the answers. Here is the
> > source code:

> > begin
> >   Application.Initialize;
> >   Application.CreateForm(TfrmMain2, frmMain2);
> >   Application.Run;
> > end.
> >     I think it goes wild in the CreateForm statement. It takes a few
> seconds
> > to lock up, so it appears that the Run statement is the culprit, but if
I
> > step through it and just wait after the CreateForm statement, it will
lock
> > up.

> I'm sure it's the CreateForm statement.
> What I was asking is the code in the OnCreate-event in the mainform.
That's
> the code in the procedure TFrmMain2.Create(Sender: TObject).
> Can you put a breakpoint on the begin-statement in that procedure and step
> throug it (press F7 to run the next row). Now you can  find the line where
> the problem occurs.
> BTW, can you load the form in Delphi without running the app?

> To let others learn from this discussion, let's follow up in the NG.

> Alfred.

Re:"Creating forms" reviseted


Well, show that code.
And try to narrow the problem down. Step through the OnActivate-procedure
and tell us on wich line the app hangs.

Alfred.

"Lloyd Edwards" <Llo...@sc.rr.com> schreef in bericht
news:63tW8.25602$Wb5.937385@twister.southeast.rr.com...

Quote
> There is no code in the "OnCreate" event handler. I put all the
> initialization code in the "OnActivate" handler.
>     Lloyd

Other Threads