• 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: CGDisplayReconfigurationCallBack
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CGDisplayReconfigurationCallBack


  • Subject: Re: CGDisplayReconfigurationCallBack
  • From: Jean-Daniel Dupas <email@hidden>
  • Date: Wed, 2 Apr 2008 01:19:24 +0200

As we are on the cocoa list, I assume you are using obj-c.
If you are using plain C API in your code, you should not have problem.
But if "// do stuff" contains some obj-c calls that can raise an exception, you have to make sure to catch it.


void DisplayReconfigurationCallBack (CGDirectDisplayID display, CGDisplayChangeSummaryFlags flags, void *userInfo)
{
if (flags & kCGDisplayAddFlag)
{
@try {
// do stuff
} @catch (NSException *exception) {
// an error occured (but should not). You can ignore it if you want. you can log it, etc...
}
}
else if (flags & kCGDisplayRemoveFlag)
{
// do different stuff
}
}


Le 2 avr. 08 à 00:12, Trygve Inda a écrit :

void DisplayReconfigurationCallBack (CGDirectDisplayID display,
CGDisplayChangeSummaryFlags flags, void *userInfo)
{
   if (flags & kCGDisplayAddFlag)
   {
       // do stuff
   }
   else if (flags & kCGDisplayRemoveFlag)
   {
       // do different stuff
   }
}

_______________________________________________

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: 
 >Re: CGDisplayReconfigurationCallBack (From: Trygve Inda <email@hidden>)

  • Prev by Date: Re: test if another app has hung
  • Next by Date: [NSPipe pipe] returning nil (running out of filehandles?)
  • Previous by thread: Re: CGDisplayReconfigurationCallBack
  • Next by thread: Re: Cocoa Tutoring in SF Bay Area
  • Index(es):
    • Date
    • Thread