• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Dis-Allowing Multiple Instances of an Application
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Dis-Allowing Multiple Instances of an Application (From: ADIL SALEEM <email@hidden>)

  • Prev by Date: Re: Dis-Allowing Multiple Instances of an Application
  • Next by Date: (no subject)
  • Previous by thread: Re: Dis-Allowing Multiple Instances of an Application
  • Next by thread: (no subject)
  • Index(es):
    • Date
    • Thread