Doing COM-ish things in OSX

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

  1. macrumors 6502a

    #1
    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

    gekko513

    #2
    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

    robbieduncan

    Staff Member

    #3
    Probably via AppleScript.
     
  4. macrumors 6502a

    csubear

    #4
    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

    (edit)

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

    Fukui

    #5
    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

    csubear

    #6

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

    robbieduncan

    Staff Member

    #7
    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

    Fukui

    #8
    http://www.macdevcenter.com

    There was another article somewhere burried at apple.com (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