Doing COM-ish things in OSX

Discussion in 'Mac Programming' started by DannySmurf, Oct 17, 2005.

  1. macrumors 6502a

    Hey guys. This is a question for all the advanced Mac programmers here. I bought Synergy a while ago and it got me wondering how programs like this work. For those who don't know, Synergy controls iTunes from a little spot in the menu bar.

    Of course, on Windows you'd do this through COM, but how is it done in OSX? Does each applciation need to expose some sort of IPC interface by itself for this kind of control to happen? Or is there something built into the OS?
  2. macrumors 603


    I just browsed quickly through the developer reference for Interapplication Communication using Cocoa, and there seems to be a number of techniques available. XML-RPC and Soap, Distributed Objects and System Services. NSDistributedNotificationCenter also lets you send messages between tasks.
  3. Moderator


    Staff Member

    Probably via AppleScript.
  4. macrumors 6502a


    There is nothing like COM on OS-X.

    COM on windows solves two problems

    a) Late bound objects
    b) RPC/IPC

    OS X solves these problems diffrently

    a) Obj-C
    b) SOAP/XML-RPC/Traditional Unix IPC/Cocoa Notification Center


    And yes most stuff like that is done with apple script hooks exposed by the application.
  5. macrumors 68000


    Right, but dont forget they changed (united) the plug-in system under OS X to use a COM interface so that carbon and cocoa could use plugins from windows and vice-versa.
  6. macrumors 6502a



    ??, not sure what you mean.
  7. Moderator


    Staff Member

    Can you post some documentation or examples of this? I'm fairly sure there is no generic plugins mechanism at all, it's up to the App developer to provide (beyond the system provided CFBundle/NSBundle help). Are you talking about a specific app?
  8. macrumors 68000



    There was another article somewhere burried at (or maybe a cocoa text-book) about cross-platform plugins using CFPlugin and COM, but basically even cocoa apps now use CFPlugin AFAIKR.

Share This Page