与其他程序进行通讯 [英] Communicating with other programs

查看:75
本文介绍了与其他程序进行通讯的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨 我希望我的程序与其他程序进行通信,例如,有些程序与游戏进行通信使游戏执行某些操作,或者有些程序在Office中产生了一些变化,例如我在C ++中的操作方式 有人告诉我们可以向某些程序发送消息,如果可以的话,那是真的吗?

解决方案

进程之间的通信是一个非常广泛而复杂的主题.要开始使用,请阅读本文 [
另一个坏消息是,一旦您想到了游戏",办公室"的答案就可能完全不同,因为它是由不同的程序员完成的,这些程序员对外部程序的通信有不同的要求.

因此,在知道如何开始之前,您似乎需要进行大量研究.对这个坏消息感到抱歉,但可悲的是,没有一个单一的魔术"可以为您完成所有工作.


您的问题非常模糊.但是,一种可能性是通过进程或线程.另一方面,它可能正在使用脚本语言,请参见手册中的页面
扩展和嵌入Python解释器


Hi i want that my program communicate with other programs for example there are some programs that communicate with games make the game do something or there are some programs that make some changes in office how i can do that in C++
someone told that we can send message to some programs is that true if yes how we can do that?

解决方案

Communication between processes is a very broad and complex subject. To get started read this article[^].


CIDev gave you a pointer to a great article. However, that article assumes that you know *how* the other program wants to be communicated with.

The bad news for you is that there is no *generic* nor *universal* way for one program to communicate with another. If you want to talk to a "game" and make it do something, you have to at least have the documentation / specification from the "game" developer on exactly what interface they implemented in the "game" that allows it to accept messages from external programs. Once you have that, then you can begin coding your end of that communication. Of course, once you know *how* to pass the messages, you then have to know *what* the message should contain. All of this should be in the documentation of that "game".

Further bad news is that once you figured that out for a "game", the answer for "office" will probably be completely different because it was done by different programmers with a different set of requirements for communication from external programs.

So, it seems you have a lot to research before you know how to start. Sorry for the bad news but it is sadly true that there ain''t no single "magic" that will do it all for you.


Your question is quite vague. However, one possibility would be through the process or thread. On the other hand, it may be using scripting languages​​, see that page from manual
Extending and Embedding the Python Interpreter


这篇关于与其他程序进行通讯的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆