I tried to register network_change event in MAC OS X 10.7 (lion) by the following code:
-------------------------------------------------------
.....
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?
-------------------------------------------------------
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?