Search code examples
.netinteropremoting

Windows messaging for interop?


Is it possible to use the windows message system as a means of interoping 2 .NET applications? How would one do this? I am looking for a way to communicate high frequency data between 2 different .NET applications. We've tried TCP/IP but found it difficult to avoid drop messages so we switched to MSMQ which works but has a performance factor and we don't need to persist the messages.

We assume these apps are running on the same PC.


Solution

  • Now that you edited your question to say that the apps are running on the same PC, I would recommend you use Named Pipes for IPC - http://msdn.microsoft.com/en-us/library/windows/desktop/aa365780(v=vs.85).aspx

    There is no reason to go through MSMQ or the TCP/IP stack if you are in the same PC, they can simply use shared memory.

    If your contract between processes is clean (and especially if it is one way) you can use the WCF NetNamedPipeBinding for an easier implementation - http://msdn.microsoft.com/en-us/library/ms752247.aspx