在两个C ++程序之间交换消息

问题描述:

我是在C ++中创建Windows应用程序的新手。我的任务是写两个cpp文件,其中一个将发送一个数字(x)到另一个,另一个将评估f(x),并发送回第一个。我应该使用消息实现它。不能得到任何具体的在线,有人可以给我一个线索,从哪里开始?
Great thanx!

I am new to creating Windows applications in C++. My task is to write two cpp files, one of which will send a number (x) to the other one, the other one will evaluate f(x) and send it back to the first one. I should implement it using Messages. Couldn't get anything specific online, Could someone pls give me a clue, where to start? Great thanx!

你在谈论窗口消息吗?如果是,发送应用程序可以使用 SendMessage ,这将导致接收应用程序得到其窗口过程执行。当然,这意味着接收应用程序需要创建一个窗口,其窗口句柄以某种方式对发送应用程序可用。

Are you talking about window messages? If so, the sending app could use SendMessage, which would cause the receiving app to get its window procedure executed. Of course, this means that the receiving app needs to create a window whose window handle is somehow made available to the sending app.