从exe导出功能 [英] Exporting Function from an Exe

查看:161
本文介绍了从exe导出功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何从exe导出功能.我想从另一个exe执行这些功能

我已经导出了函数,就像我们在DLL中导出

从另一个exe调用后,它给出访问冲突错误.

How I can export functions from an exe. I want to these functions from another exe

I have exported functions like we are exporting in DLL

After calling from another exe it is giving access violation error.

推荐答案

将要共享的功能放在一个额外的DLL中,并从两个应用程序中导入该DLL exe文件.这是共享功能的常用方法.

如果您只想共享几个小功能,则使用静态库(对象库)可能是更易于维护的替代方法.
Place the functions that you want to share in an extra DLL and import that DLL from both of your application exe files. That is the usual way of sharing functions.

If you just want to share a couple of small functions, the use of a static library (object library) might be an alternative that is easier to maintain.


如果您使用的是COM,则它是可能的.另一种方法是上钩.查看是否 [ ^ ]帮助.
If you are using COM then it is possible. Other way is hooking. See if this[^] helps.


您需要某种形式的IPC来调用另一个可执行文件的功能(而DLL被映射到调用进程的地址空间中). /> 为此,您可以实现COM进程外组件.
You need some form of IPC to call a function of another executable (while DLLs are mapped into the calling process address space).
You may implement a COM out-of-process component, for the purpose.


这篇关于从exe导出功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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