Re: CGDisplayReconfigurationCallBack

2008-04-01 Thread Jean-Daniel Dupas
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 (CGDirectDispla

Re: CGDisplayReconfigurationCallBack

2008-04-01 Thread Trygve Inda
What exactly would I put in here? It calls into my code with void DisplayReconfigurationCallBack (CGDirectDisplayID display, CGDisplayChangeSummaryFlags flags, void *userInfo) { if (flags & kCGDisplayAddFlag) { // do stuff } else if (flags & kCGDisplayRemoveFlag) {

Re: CGDisplayReconfigurationCallBack

2008-03-30 Thread Jean-Daniel Dupas
It does not say to not use longjmp, it sais to not use longjmp to jump outside this function. Just encapsulate your code in a @try / @catch() block to ensure that even if an exception occurs (@throw use longjmp in the 32 bits runtime), it will jump in your catch block and not outside you