FROM : Jean-Daniel Dupas
DATE : Wed Apr 02 01:19:24 2008
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
> }
> }
DATE : Wed Apr 02 01:19:24 2008
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
> }
> }
| Related mails | Author | Date |
|---|---|---|
| Trygve Inda | Mar 30, 15:31 | |
| Jean-Daniel Dupas | Mar 30, 16:05 | |
| Trygve Inda | Apr 2, 00:12 | |
| Jean-Daniel Dupas | Apr 2, 01:19 |






Cocoa mail archive

