Hi Cord

I have already done that, but simply using ShowMessage calls, asking the
operator to specify the last message that appeared.  I guess you didn't see
my original message 2 or 3 weeks ago where I quoted this...

 SplashForm := TSplashForm.Create(Application);
 SplashForm.Show;
 showmessage('Initialize 1');
 Application.Initialize;
 showmessage('Initialize 2');
 Application.Title := 'Studio';
 Application.CreateForm(TStudioForm, StudioForm);
 showmessage('Initialize 3'); <<< IT DOESN'T GET HERE

The user reports the last message is 'Initialize 2'.

I established that all the Initialization routines are called before it gets
to the SplashForm.

Note that for one user, he managed to resolve the problem by restoring his
Windows Vista to an earlier restore point!

It would be nice to have a crash message appear, but nothing appears.

As Laurent mentions, I also think it must be a component on the form that is
hanging. It would take a long time to create every component inside code,
but I guess I will need to find time to do this.

Alternatively, as I have the source code to all components, I guess I could
put some showmessages or OutputDebugString's in each constructors Create
procedures.

Ross.

-----Original Message-----
From: delphi-boun...@elists.org [mailto:delphi-boun...@elists.org] On Behalf
Of Cord Schneider
Sent: Wednesday, 8 July 2009 9:21 p.m.
To: delphi@elists.org
Subject: RE: App hanging during load

Hi Ross,

> So what does this mean?  What else is executing during for
> CreateForm procedure that could cause it to hang?  How can
> I debug this?  I have MadExcept compiled in but it doesn't
> activate.

If you are unable to debug the application in the 'traditional' way, I
would suggest scattering OutputDebugString() liberally throughout your
code and then using a tool like DebugView to monitor the output. Pass
decent comments to OutputDebugString() so that you can see what the last
one was that was executed before your application hung. Seek out places
like Initialization sections of units and add calls to
OutputDebugString() there too.

So for example, if you had the following:

program Project1;

uses
  Forms,
  Unit1 in 'Unit1.pas' {Form1},
  Unit2 in 'Unit1.pas' {Form2},
  Unit3 in 'Unit1.pas' {Form3};

{$R *.RES}

begin
  Application.Initialize;
  Application.CreateForm(TForm1, Form1);
  Application.CreateForm(TForm2, Form2);
  Application.CreateForm(TForm3, Form3);
  Application.Run;
end.

You could start by doing something like this:

program Project1;

uses
  Forms,
  Unit1 in 'Unit1.pas' {Form1},
  Unit2 in 'Unit1.pas' {Form2},
  Unit3 in 'Unit1.pas' {Form3};

{$R *.RES}

begin
  OutputDebugString(PChar('Calling Application.Initialize'));
  Application.Initialize;
  OutputDebugString(PChar('Calling Application.CreateForm(TForm1,
Form1)'));
  Application.CreateForm(TForm1, Form1);
  OutputDebugString(PChar('Calling Application.CreateForm(TForm2,
Form2)'));
  Application.CreateForm(TForm2, Form2);
  OutputDebugString(PChar('Calling Application.CreateForm(TForm3,
Form3)'));
  Application.CreateForm(TForm3, Form3);
  OutputDebugString(PChar('Calling Application.Run'));
  Application.Run;
  OutputDebugString(PChar('All done.'));
end.

Run DebugView on the machine that's causing the problems and then run
your application and see what the last message was that was sent to the
debugger. Identify the unit that caused everything to hang, and then
start adding OutputDebugString() to that unit. Keep repeating these
steps until you can find where the cause of the problem is. Your biggest
obstacle will be units that you don't have the source code for. If
you're using some component that you only have DCUs for, and they have
something in their Initialization section that causes your application
to hang, then I'm afraid that you're on your own!

Unfortunately, there's not going to be an easy way to do this: it's
going to take a lot of time and even more patience. Good luck!

Cord Schneider
StaffPlan
http://www.staffplan.co.uk/


For more information about OutputDebugString() see
http://msdn.microsoft.com/en-us/library/aa363362(VS.85).aspx
For more information about DebugView see
http://technet.microsoft.com/en-us/sysinternals/bb896647.aspx
_______________________________________________
Delphi mailing list -> Delphi@elists.org
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi

_______________________________________________
Delphi mailing list -> Delphi@elists.org
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi

Reply via email to