(C ++)如何在不同的应用程序之间使用Windows消息队列。 [英] (C++) How to use Windows message Queue between different applications.
本文介绍了(C ++)如何在不同的应用程序之间使用Windows消息队列。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有两个不同的Win32 consol应用程序。这两个应用程序都有多个线程。我想将来自application_1的add_1的消息发送到applcation_2的thread_1。我可以这样做吗?如果是..那么我需要做什么?
我在相同应用程序的线程之间使用了消息队列,但是如果我想对不同应用程序的线程做同样的事情?
谢谢,
问候,
Saurabh Raoot
解决方案
您要做的是称为进程间通信(IPC)。它比流程中的线程之间的通信更复杂。有很多机制可以达到这个目的。
这里给出一个概述:
http://msdn.microsoft.com/en-us/library/windows /desktop/aa365574(v=vs.85).aspx [ ^ ]
你需要弄清楚你希望如何做到这一点但共享内存是一种选择。
使用共享的进程间通信记忆 [ ^ 一>
Hi,
I have two different Win32 consol applications. Both these applications has multiple threads. I want to send message from thead_1 of application_1 to thread_1 of applcation_2. Can I do this ?? If yes .. then what all I need to do ??
I have used message queue beween threads of same application, but If I want to do same with threads of different applications ?
Thanks,
Regards,
Saurabh Raoot
解决方案
What you seek to do is called inter process communication (IPC). It is more complex than communicating between threads within a process. There are many mechanisms to achieve this.
An overview is given here:
http://msdn.microsoft.com/en-us/library/windows/desktop/aa365574(v=vs.85).aspx[^]
You will need to work out how you wish to do this but shared memory is an option.
Interprocess Communication using Shared Memory[^]
这篇关于(C ++)如何在不同的应用程序之间使用Windows消息队列。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文