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. ATL / WTL / STL
  4. COM or DCOM?

COM or DCOM?

Scheduled Pinned Locked Moved ATL / WTL / STL
comhelpquestion
11 Posts 8 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.
  • P progDes

    Hi guys, I'm confused. I need to create interprocess communications between x64 and x86 processes running on the same machine. Can I use COM for it? Cannot see anything on web. Or does that mean that I must use DCOM? Thanks for help.

    M Offline
    M Offline
    Marco Bertschi
    wrote on last edited by
    #2

    Both COM and DCOM are dangerous to use and can easily crash both processes if there is a bug. IMHO it is better when you use sockets for the inter-process communications because it makes the way your communication works more reliable and the two processes gain a bit of independence (of course you have to add error handling for failed communication attempts, otherwise you are having the same problem as with DCOM and COM). Just my two cents about how we use to do it at our company.

    cheers Marco Bertschi


    Software Developer Twitter | Facebook | Articles


    You have absolutely no idea how glad I am that I have no idea at all. - OriginalGriff

    P 1 Reply Last reply
    0
    • M Marco Bertschi

      Both COM and DCOM are dangerous to use and can easily crash both processes if there is a bug. IMHO it is better when you use sockets for the inter-process communications because it makes the way your communication works more reliable and the two processes gain a bit of independence (of course you have to add error handling for failed communication attempts, otherwise you are having the same problem as with DCOM and COM). Just my two cents about how we use to do it at our company.

      cheers Marco Bertschi


      Software Developer Twitter | Facebook | Articles


      You have absolutely no idea how glad I am that I have no idea at all. - OriginalGriff

      P Offline
      P Offline
      progDes
      wrote on last edited by
      #3

      I will take into account your 2 cents :). Still, the question is open.

      M 1 Reply Last reply
      0
      • P progDes

        I will take into account your 2 cents :). Still, the question is open.

        M Offline
        M Offline
        Marco Bertschi
        wrote on last edited by
        #4

        Off course there are opportunities when you need to use COM or DCOM, but the savest way of using them is to avoid the usage :laugh: .

        cheers Marco Bertschi


        Software Developer Twitter | Facebook | Articles


        You have absolutely no idea how glad I am that I have no idea at all. - OriginalGriff

        1 Reply Last reply
        0
        • P progDes

          Hi guys, I'm confused. I need to create interprocess communications between x64 and x86 processes running on the same machine. Can I use COM for it? Cannot see anything on web. Or does that mean that I must use DCOM? Thanks for help.

          J Offline
          J Offline
          Jonathan Davies
          wrote on last edited by
          #5

          I've only used DCOM between machines and processes. When I did try to use it quite a while ago, I soon gave up on it due to security and permission problems when trying to do anything between machines in a corporate environment and so used MSMQ (Message Queuing) instead - much easier to work with and provides nice decoupling. Setup a named queue, connect at one end to post messages, connect at the other end to receive messages. Makes testing easy too. As others have said there are other ways as well.

          T 1 Reply Last reply
          0
          • P progDes

            Hi guys, I'm confused. I need to create interprocess communications between x64 and x86 processes running on the same machine. Can I use COM for it? Cannot see anything on web. Or does that mean that I must use DCOM? Thanks for help.

            P Offline
            P Offline
            pasztorpisti
            wrote on last edited by
            #6

            I would definitely use a socket for IPC, maybe shared memory in some cases. The most lightweight interprocess communication channel is probably an unnamed pipe but sockets are more flexible not to mention that the loopback interface is decoupled from the network stack so if both endpoints are on your machine then sockets are super-fast. With sockets you have the opportunity to run the processes on different machines anytime without much effort (possible with name pipes too, but thats more hassle and not crossplatform like sockets). In my opinion COM and DCOM are just unnecessary complications to solve your problem.

            1 Reply Last reply
            0
            • J Jonathan Davies

              I've only used DCOM between machines and processes. When I did try to use it quite a while ago, I soon gave up on it due to security and permission problems when trying to do anything between machines in a corporate environment and so used MSMQ (Message Queuing) instead - much easier to work with and provides nice decoupling. Setup a named queue, connect at one end to post messages, connect at the other end to receive messages. Makes testing easy too. As others have said there are other ways as well.

              T Offline
              T Offline
              Tratilu
              wrote on last edited by
              #7

              ghfd

              1 Reply Last reply
              0
              • P progDes

                Hi guys, I'm confused. I need to create interprocess communications between x64 and x86 processes running on the same machine. Can I use COM for it? Cannot see anything on web. Or does that mean that I must use DCOM? Thanks for help.

                B Offline
                B Offline
                bkelly13
                wrote on last edited by
                #8

                I backup the opinions on using sockets. Use them. That knowledge will help in the long run and will be good for other platforms. I wrote some articles on TCP/IP that might be useful. Search for them on this site.

                Thanks for your time If you work with telemetry, please check this bulletin board: http://www.bkelly.ws/irig\_106/

                L 2 Replies Last reply
                0
                • P progDes

                  Hi guys, I'm confused. I need to create interprocess communications between x64 and x86 processes running on the same machine. Can I use COM for it? Cannot see anything on web. Or does that mean that I must use DCOM? Thanks for help.

                  I Offline
                  I Offline
                  imagiro
                  wrote on last edited by
                  #9

                  You can use COM objects if you make sure they are automation compatible (have the [oleautomation] attribute and use only automation compatible types in their methods). This will assure that all required marshalling code exists - it will be just like DCOM. There might be other ways (like writing your own marshalling code), but this is a way that will work. You can, of course, also use DCOM. However, it depends very much on the details of your project, is this is the right way. The advantages are, that COM takes care of everything, like marshalling your data correctly (even between 32/64 bit processes). But also you might run into a lot of things that will be not so easy to solve for unexperienced COM programmers. There are quite some articles here on CP about IPC, might be worth to take a look there. In case you want to experiment a bit (and I would strongly suggest that before you decide for a certain solution!) I would suggest WTL (check out http://www.codeproject.com/kb/wtl/ [^]. A series of some very good articles is Michael Dunn's WTL for MFC Programmers). Create a project with the option "Create as COM Server" (will appear in the Application wizard). It will give you an exe project with a UI, that also acts as a COM server. Create two such projects in your solution, add some COM objects and start to play around a bit.

                  1 Reply Last reply
                  0
                  • B bkelly13

                    I backup the opinions on using sockets. Use them. That knowledge will help in the long run and will be good for other platforms. I wrote some articles on TCP/IP that might be useful. Search for them on this site.

                    Thanks for your time If you work with telemetry, please check this bulletin board: http://www.bkelly.ws/irig\_106/

                    L Offline
                    L Offline
                    Lost User
                    wrote on last edited by
                    #10

                    ‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌

                    /* LIFE RUNS ON CODE */

                    1 Reply Last reply
                    0
                    • B bkelly13

                      I backup the opinions on using sockets. Use them. That knowledge will help in the long run and will be good for other platforms. I wrote some articles on TCP/IP that might be useful. Search for them on this site.

                      Thanks for your time If you work with telemetry, please check this bulletin board: http://www.bkelly.ws/irig\_106/

                      L Offline
                      L Offline
                      Lost User
                      wrote on last edited by
                      #11

                      ‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌‌

                      /* LIFE RUNS ON CODE */

                      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