1
votes

I have created an application on Delphi 7. my app had running fine since yesterday. I don't know what's happened yesterday which cause my application halts on Application.Initialize line in source code and does not return to next line when i trace the program. I can't run the created executable file from widows niether while the generated file does run on another machine correctly. here is the code where the compiler stops on it:

program Info_Kiosk;

uses SysUtils, Forms, ... (some other units) ;

{$R *.res}

begin
Application.Initialize;

Application.CreateForm(Tfrm_Main, frm_Main);

any help would be appreciated

1

1 Answers

6
votes

The implementation of TApplication.Initialize looks like this:

procedure TApplication.Initialize;
begin
  if InitProc <> nil then TProcedure(InitProc);
end;

So, look through your code for anything that assigns to InitProc.

Another approach is to use your debugger to help you. Enable Debug DCUs. Then set a break point on the call to Application.Initialize in your .dpr file. Then step into that procedure with F7. Then step into the call to InitProc and follow that along until you reach the code that blocks.

If you are using a revision control system you can simply check out older versions of the project and use a binary search to find the commit that introduced the behaviour. If you are not using revision control, start doing so now.