Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. COM
  4. COM Communication

COM Communication

Scheduled Pinned Locked Moved COM
questionoraclecomsecurityjson
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    HakunaMatada
    wrote on last edited by
    #1

    Although a very basic question, but can anybody tell me what COM uses internally to talk between components? Is the mode of communication same for COM and DCOM or are they different? Do they use RPC, Sockets, Pipes, etc...? Thanks.

    --- :beer: Hakuna-Matata :beer: It means no worries for the rest of your days... It's our problem free, Philosophy :jig: "I think my response was 'What idiot dreamed this up?'" -- Mary Ann Davidson, Oracle's chief security officer, in typical blunt manner, remembering her reaction to the company's scheme to brand its databases as "unbreakable."

    M 1 Reply Last reply
    0
    • H HakunaMatada

      Although a very basic question, but can anybody tell me what COM uses internally to talk between components? Is the mode of communication same for COM and DCOM or are they different? Do they use RPC, Sockets, Pipes, etc...? Thanks.

      --- :beer: Hakuna-Matata :beer: It means no worries for the rest of your days... It's our problem free, Philosophy :jig: "I think my response was 'What idiot dreamed this up?'" -- Mary Ann Davidson, Oracle's chief security officer, in typical blunt manner, remembering her reaction to the company's scheme to brand its databases as "unbreakable."

      M Offline
      M Offline
      Mike Dimmick
      wrote on last edited by
      #2

      If calling between code in the same process, in the same context, in the same apartment, there is no translation whatever. It's the same as making a virtual function call to another class in your own code. If in a different COM+ context in the same apartment, it marshals the arguments to make any pointers context-relative, executes any code to set up the thread for the new context, and unmarshals arguments and calls the method. On return it again sets up the thread for the right context, remaps any pointers for the right context (to ensure correct interception occurs) and returns to the caller. If in a different apartment, it depends on the receiving apartment. If the receiving apartment is an STA, it will have created a hidden window to receive incoming calls. The arguments are marshalled and a window message sent to that hidden window. When the receiving thread's message pump picks up the message and dispatches it to the window procedure, the window procedure makes the call. The calling thread waits (pumping messages, if an STA) until the call returns. If the receiving apartment is an MTA, it uses RPC, but a special RPC channel called Local RPC, to get the call onto a worker thread. If going cross-process, again it uses windows messaging to target an STA, and RPC to target an MTA. For DCOM RPC is always used.

      DoEvents: Generating unexpected recursion since 1991

      H 1 Reply Last reply
      0
      • M Mike Dimmick

        If calling between code in the same process, in the same context, in the same apartment, there is no translation whatever. It's the same as making a virtual function call to another class in your own code. If in a different COM+ context in the same apartment, it marshals the arguments to make any pointers context-relative, executes any code to set up the thread for the new context, and unmarshals arguments and calls the method. On return it again sets up the thread for the right context, remaps any pointers for the right context (to ensure correct interception occurs) and returns to the caller. If in a different apartment, it depends on the receiving apartment. If the receiving apartment is an STA, it will have created a hidden window to receive incoming calls. The arguments are marshalled and a window message sent to that hidden window. When the receiving thread's message pump picks up the message and dispatches it to the window procedure, the window procedure makes the call. The calling thread waits (pumping messages, if an STA) until the call returns. If the receiving apartment is an MTA, it uses RPC, but a special RPC channel called Local RPC, to get the call onto a worker thread. If going cross-process, again it uses windows messaging to target an STA, and RPC to target an MTA. For DCOM RPC is always used.

        DoEvents: Generating unexpected recursion since 1991

        H Offline
        H Offline
        HakunaMatada
        wrote on last edited by
        #3

        Thank You. :)

        --- :beer: Hakuna-Matata :beer: It means no worries for the rest of your days... It's our problem free, Philosophy :jig: "I think my response was 'What idiot dreamed this up?'" -- Mary Ann Davidson, Oracle's chief security officer, in typical blunt manner, remembering her reaction to the company's scheme to brand its databases as "unbreakable."

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups