My delphi-7 application is running properly from code(Delphi-IDE), but it is not running if i double click directly on exe, Just it is blinking , I thought that it is opening and closing automatically.
please give the solution if any one knows.
DelphiPascal
Last Comment
ChrisBerry
8/22/2022 - Mon
btframework
It may happen if there is some dlls missing. First, check
Project->Options->Packages->Build with runtime packages
is unchecked.
inampudi1
ASKER
dear expert, thank you for your reply But,
If I check that it is not running from Delphi IDE also,
btframework
Add ShowMessage("LaLa") in main project file (between begin and end) before Application.CreateForm and check will it appear. Then add it after Application.Run and check again
Also add ShowMessage in main form OnCreate event handler.
Thank You, for your suggestion,
but i am unable to decide by that also.
please give me any other solution.
btframework
Does any one of ShowMessage appear? It is hard to say what can be wrong with your project becasue you gave too little info.
How many forms created on startup? What is in OnCreate and OnShow of those forms? Do you open some files wher your app starts? Database connections? It seems like unhandled exception raises when your app starts.
ChrisBerry
Does your code run from the exe if the IDE is running? Have you used any components that will only run if the IDE is running?
check your project options which one is the main form and the creation order of other components.You have a component that is getting created/displayed when it should not (before your main form) so that is why your mainform is blanked out.
this error is common when using datamodule.
inampudi1
ASKER
These are the answers i am providing to all Experts who raised the Queries.
Q : Does any one of ShowMessage appear?
A : Appearing like blink, means no user control. message boxes are coming closing without pressing OK button also
Q : How many forms created on startup?
A : i am creating one form and checking some parameters if needed i am continuing with application or else terminating this is the code for project file
(*********************************************************)
program Project1;
uses
Forms,
Unit1 in 'Unit1.pas' {Form1},
Unit2 in 'Unit2.pas' {Form2},
Unit3 in 'Unit3.pas' {Form3},
uQueue in 'uQueue.pas',
Unit4 in 'Unit4.pas' {Form4},
uReportQueue in 'uReportQueue.pas',
uReport in 'uReport.pas' {fReport},
uDailyReport in 'uDailyReport.pas',
uEffectReport in 'uEffectReport.pas';
{$R *.res}
begin
Application.Initialize;
Application.Title := 'XXXXXXXXXXX';
Application.CreateForm(TForm3, Form3);
if not valid then
Begin
Application.Terminate;
End;
Application.CreateForm(TForm1, Form1);
Application.CreateForm(TForm2, Form2);
Application.CreateForm(TForm4, Form4);
Application.CreateForm(TfReport, fReport);
Q : Database connections?
A : No Database connections
Q : Does your code run from the exe if the IDE is running?
A : Yes EXE is running like same(Opening and closing) if Application is running from IDE also.
Q : Do you open some files wher your app starts?
A : Yes, I can
btframework
This code lines:
if not valid then
Begin
Application.Terminate;
End;
what is "valid" value? It seems like from outside IDE valid is false.
How do you open files? With AssignFile method? If yes, do files exist? Are paths to the files valid?
Application.Initialize;
Application.Title := 'XXXXXXXXXXX';
//Application.CreateForm(TForm3, Form3);
if not valid then
ShowMessage('Not valid')
//Application.Terminate
else begin
ShowMessage('Valid')
//Application.CreateForm(TForm1, Form1);
//Application.CreateForm(TForm2, Form2);
//Application.CreateForm(TForm4, Form4);
//Application.CreateForm(TfReport, fReport);
Application.Run;
end;
then uncomment CreateForm one by one to find where is the problem
inampudi1
ASKER
Thank You for your Response
But
If I write ShowMessage in Project file it is giving error as "undeclared identifier : 'showmessage' "
senad
Yes, " if not valid then" crap is nonsense.
You do not check something that is to be created automatically.
If you want form out of compiler routine then set your form to list of "available" forms.
You either have it or you dont.... :-)
if I remove that condition and by simply writing the form creations then also it in not working.
senad
rename your form3 to splashscreen...
btframework
Well. I think it would be god to see Form3.Create source code. If you afraid about source code leaking you may contact me directly (MSN or e-mail) or lets try to use remote debuggin session (with TeamViewer). It is the case when it is very hard to say what may happen. It is like do madical diagnostic with using just a photo of patient.
You do not check for "creation" of forms in Delphi.
Application does that for you.
You just set which is the main one and creation orders.
It seems to me your mainform is Form1 and you are trying to create Form3 before it.
btframework
to senad
Actually if his Form3 is splash screen then it does not matter. I think the problem is in Valid variable which may set up after some checks. The check may failed if something wrong with path.
And of course, it may run different from IDE because debugger.
inampudi1
ASKER
hi experts,
I am using ProfGrid Version 3.4.4.8 for Delphi7. After struggling a lot I found that because of ProfGrid my application is not running from EXE (but running from Delphi Code). Please find the attachment for sample code.
Please remove the file extension "txt" from the attached zip achieve.
Project->Options->Packages
is unchecked.