Re: Strange kAXErrorAPIDisabled error on AXObserverAddNotification
Re: Strange kAXErrorAPIDisabled error on AXObserverAddNotification
- Subject: Re: Strange kAXErrorAPIDisabled error on AXObserverAddNotification
- From: David Niemeijer <email@hidden>
- Date: Mon, 29 May 2006 21:40:31 +0200
At 10:55 -0700 29/5/06, Eric Schlegel wrote:
On May 29, 2006, at 7:30 AM, David Niemeijer wrote:
When I call AXObserverAddNotification early on in my application I
am getting a -25211 (kAXErrorAPIDisabled) error when I install the
notification for my app's own PID, not when I do the same for, for
example the Dock. AXAPIEnabled() returns true and I have Access for
Assistive Device turned on all the time. I am installing a
kAXFocusedUIElementChangedNotfication in case that matters and
running 10.4.6 on Intel.
Anyone an idea why I might get that error despite the fact that AX
is enabled....
I think you're calling this API before Carbon or Cocoa have a chance
to register the app with the AX implementation. Try delaying your
AddNotification call until you've made at least one call to the
runloop. One easy way to do this without processing any events is to
call RunCurrentEventLoop(0).
Ah, I see. Well, I guess I thought I was calling this after the
runloop started because it was called in response to a
kEventCommandProcess event that is generated by ProcessHICommand. But
now I see that ProcessHICommand directly dispatches it instead of
queuing it up for processing by the event loop...
How could I best queue a kEventCommandProcess event to be processed
during the first round of the application event loop?
Thanks,
david.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Accessibility-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden