Re: Dis-Allowing Multiple Instances of an Application
Re: Dis-Allowing Multiple Instances of an Application
- Subject: Re: Dis-Allowing Multiple Instances of an Application
- From: "Julien Jalon" <email@hidden>
- Date: Tue, 4 Mar 2008 09:59:37 +0100
Do something like:
CFMessagePortRef identityPort = CFMessagePortCreateLocal(NULL, CFSTR("
com.mycompany.myapplication.unique"), NULL, NULL, NULL);
if(identityPort == NULL) {
printf(stderr, "Application is already launched\n");
exit(1);
} // else keep this port around, it will be destroyed once the application
exits
--
Julien
On Tue, Mar 4, 2008 at 9:27 AM, ADIL SALEEM <email@hidden> wrote:
> Hi,
>
> I have made an application in Cocoa. From GUI it's multiple instances can
> not be launched. However, from command shell, multiple instances of the
> application can be launched.
>
> I want to run only one instance of my application at a time. It should
> not be able to create multiple instances even from the command prompt.
>
> Please guide me how can i achieve that ? Thanx in advance.
>
> ADIL
>
>
> ---------------------------------
> Looking for last minute shopping deals? Find them fast with Yahoo!
> Search.
> _______________________________________________
>
> Cocoa-dev mailing list (email@hidden)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
>
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden