如何在我的C#项目中使用外部程序的功能? [英] How to use functions of external program in my C# project?

查看:97
本文介绍了如何在我的C#项目中使用外部程序的功能?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些exe程序,似乎它是用VC编写的(它使用msvcr70,msvcr70d,msvcr71).
如何将这个exe文件包含到我的C#项目中以使用内部函数?
我尝试通过添加引用"进行尝试,但未成功.

I have some exe-program, it seems it was written in VC (it uses msvcr70, msvcr70d, msvcr71).
How can I include this exe-file into my C# project for using internal functions?
I tried via Add Reference, but unsuccessfully.

推荐答案

给出的链接仅适用于.NET文件.没有办法做到这一点.除非程序使用COM或C ++/CLI,否则这两个程序之间就没有桥梁.如果应用程序是COM,则添加引用将起作用.否则,它显然是行不通的,您也将无法做到这一点. C ++程序一旦编译,甚至不会包含您想要以任何有意义的方式调用的函数,它们已经过优化并编译为机器代码.

无法完成.
The link you were given is only for .NET files. There is no way to do this. Unless the program uses COM, or C++/CLI, there is no bridge between the two programs. Add Reference would work if the app was COM. Otherwise, it plainly is not going to work, nor are you going to be able to do it. A C++ program, once compiled, won''t even contain the functions you want to call in any meaningful way, they''ve been optimised and compiled into machine code.

Can''t be done.


您需要加载exe.在codeproject上尝试此链接. [
You would need to load the exe. Try this link on codeproject.[^]


错误的想法.也许我可以监视该程序在工作时发送给自身的消息和参数.并将它们从我的C#发送到工作程序.但是怎么办呢?
Bad ideas. Maybe I can monitor messages and parameters, which this program sends to itself at work. And send them from my c# to working program. But how to do it?


这篇关于如何在我的C#项目中使用外部程序的功能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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