COM or DCOM?
-
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.
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
-
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
-
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
-
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'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.
-
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 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.
-
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.
-
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 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/
-
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.
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. -
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/
-
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/