Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

vrajasekhar

macrumors newbie
Original poster
May 9, 2012
1
0
Bangalore, India
I tried to register network_change event in MAC OS X 10.7 (lion) by the following code:

-------------------------------------------------------
Code:
[INDENT]#define kNotifySCNetworkChange "com.apple.system.config.network_change"
void init()
{

   status = notify_register_check(kNotifySCNetworkChange, &token);
   if (status != NOTIFY_STATUS_OK)
   {
       cout << "Event Registration failed" <<endl;
   }
   cout << "Event Registration Success" << endl;

}[/INDENT]

.....

If I use this code in a sample program, it registered successfully. If I use this in my application, notify_register_check() function returned with status 1000000 (NOTIFY_STATUS_FAILED). In addition, the errno returned is 0.

Note: My application is working in Leopard and Snow Leopard with out any issue (registration success)

I googled for this status but couldn't found the relevant information. Can anyone just tell me in which scenarios this NOTIFY_STATUS_FAILED is returned?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.