2015-09-29 10:35 GMT-03:00 Michael Van Canneyt <mich...@freepascal.org>:

>
>
> On Tue, 29 Sep 2015, Juha Manninen wrote:
>
> On Tue, Sep 29, 2015 at 2:50 PM, Michael Van Canneyt
>> <mich...@freepascal.org> wrote:
>>
>>> I am not proposing to make a new class.
>>> I want a property "SingeInstance" in CustApp which activates this
>>> automatically.
>>>
>>
>> I had the very same idea when this was discussed a long time ago in
>> Lazarus list.
>> Martin Friebe noted that every application would then depend on this
>> single-instance IPC code.
>> It was a valid point. There should not be such a dependency.
>>
>
> For simpleIPC, yes. But the new implementation has no dependencies except
> sysutils, classes. So the argument becomes void.
>
> That's why I was glad with Ondrej's implementation.
>
>
>> The right way is to use a drag-and-drop LCL component like the one
>> from Luiz Américo.
>>
>
> That is IMHO a completely wrong implementation for 2 reasons:
>
>
It can be used without the component. The component is just a convenience.
 See the examples


> 1. Using a LCL component means that you must instantiate a form/datamodule
> first.
>    By that time, a database connection may already have been made (just
>    to name something), which is exactly what you want to avoid.
>
>

>    The check for single instance should be done before the first form is
> created.
>

It can be done


>
> 2. Then it is only available in visually designed applications.
>    Services, website servers and custom console apps are non-visual.
>    I am specificially thinking FastCGI processes.
>
>
See above


>    All these have in common that they descend from TCustomApplication.
>
>
And console apps without TCustomApplication?

Luiz
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply via email to