<br><br><div class="gmail_quote">On 13 March 2011 13:53, Frank Church <span dir="ltr"><<a href="mailto:vfclists@gmail.com">vfclists@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<br><br><div class="gmail_quote"><div><div></div><div class="h5">On 13 March 2011 08:43, Sven Barth <span dir="ltr"><<a href="mailto:pascaldragon@googlemail.com" target="_blank">pascaldragon@googlemail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Am 13.03.2011 00:22, schrieb Frank Church:<div><br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
I am using 0.9.28,3 with FPC 2,4,0 on Window.<br>
<br>
I further reduced it to this<br>
<br>
program Demo_LoadPersistenceLayerIfDef_Laz;<br>
<br>
{$mode objfpc}{$H+}<br>
<br>
uses<br>
{$IFDEF UNIX}{$IFDEF UseCThreads}<br>
cthreads,<br>
{$ENDIF}{$ENDIF}<br>
Interfaces, // this includes the LCL widgetset<br>
Forms, //frmMain,<br>
//LResources,<br>
<br>
DemoDBUtils in '..\Common\DemoDBUtils.pas';<br>
<br>
{$IFDEF WINDOWS}{$R Demo_LoadPersistenceLayerIfDef_Laz.rc}{$ENDIF}<br>
</blockquote>
<br></div>
You can disable this one, too.<div><br>
<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<br>
begin<br>
//{$I Demo_LoadPersistenceLayerIfDef_Laz.lrs}<br>
Application.Initialize;<br>
//Application.CreateForm(TForm1, Form1);<br>
//Application.Run;<br>
ShowConnectedDatabases;<br>
end.<br>
<br>
<br>
Thanks for your response.<br>
<br>
And it looks like Application requires Interfaces and Forms, and from<br>
what you describe the ShowConnectedDatabases is probably only working at<br>
the end of the program's execution.<br>
</blockquote>
<br></div>
As you've disabled the "Application.Run" call it will work immediatly (if at all), because the potentially endless main loop is not started.<div><br>
<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Is it possible that a GUI app will<br>
work without TApplication on Windows, or at the least one that requires<br>
only the dialog?<br>
</blockquote>
<br></div>
You can try to disable the "Application.Initialize" call as well to see what happens, but I can't tell what the Win32 LCL needs to show a simple dialog...<br>
<br>
Note: If you can successfully remove this call, you can remove the usage of unit "Forms" as well. The unit "Interfaces" must be kept though and if you don't need threads (on non-Windows) you can remove the part containing "cthreads" as well.<br>
<br></blockquote></div></div><div><br>Application.Initialize is necessary in this case. The dialog does not come up unless it is executed.<br><br>I will try it in 0.9.31 and FPC 2.5.1 on both Windows and Win32 to find out.<br>
<br><br>
</div><div class="im"><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Regards,<br>
Sven<br><font color="#888888">
<br>
--<br>
_______________________________________________<br>
Lazarus mailing list<br>
<a href="mailto:Lazarus@lists.lazarus.freepascal.org" target="_blank">Lazarus@lists.lazarus.freepascal.org</a><br>
<a href="http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus" target="_blank">http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus</a><br>
</font></blockquote></div></div><br><br clear="all"><div><div></div><div class="h5"><br></div></div></blockquote><div><br>More on the Application object<br><br>Will all the lines that come after Application.Run command execute only after the Application is terminated? The ShowConnectedDatabases does not execute if placed after the Application.Run command.<br>
<br>From what you mentioned earlier is that what the event loop is about? ie after Application.Initialize the forms can be created, then event loop begins to process UI and other events?<br><br>Does that mean after the forms and data module objects are created, they will not respond to GUI events until Application.Run is executed?<br>
<br>I suspect that non GUI events can still be processed, without the Application.Run command such as webservers and other data module activities??<br><br> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div><div class="h5">-- <br>Frank Church<br><br>=======================<br><a href="http://devblog.brahmancreations.com" target="_blank">http://devblog.brahmancreations.com</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Frank Church<br><br>=======================<br><a href="http://devblog.brahmancreations.com">http://devblog.brahmancreations.com</a><br>