Carbon Services under Cocoa app?
Carbon Services under Cocoa app?
- Subject: Carbon Services under Cocoa app?
- From: Kevin Walzer <email@hidden>
- Date: Sun, 03 Jan 2010 17:59:41 -0500
- Organization: WordTech Communications LLC
I'm trying to transition some well-debugged Carbon code that implements
services to a Cocoa-based version of my application. Because the code
works fine under 32-bit Carbon, I'd rather not rework that code in Cocoa
unless necessary.
What I'm finding is that the Carbon-based code is no-op under Cocoa,
both in 64- and 32-bit builds of my application. It compiles fine and
doesn't cause any errors when run, but it simply doesn't do anything.
The code uses functions like this:
OSStatus respondToServicesEvent(EventHandlerCallRef inHandlerCallRef,
EventRef inEvent,
void *userData) {
int eventType = GetEventKind(inEvent);
fprintf(stderr, "got svcs event %d\n",eventType);
switch (eventType) {
case kEventServiceGetTypes:
return respondToServiceTypesEvent(inEvent);
case kEventServiceCopy:
return respondToServiceCopyEvent(inEvent);
case kEventServicePerform:
return respondToServicePerformEvent(inEvent);
}
return noErr;
}
InstallApplicationEventHandler(respondToServicesEvent, 4,
carbonServiceEvents, NULL, NULL);
Is there any reason why such code wouldn't work? I have everything set
up correctly in the info.plist file, so that isn't an issue. And Cocoa
apps still have to call into the Carbon event loop for things like
global hotkeys, as far as I can tell.
Advice is appreciated.
--
Kevin Walzer
Code by Kevin
http://www.codebykevin.com
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden