将DLL添加到资源中
我的应用程序使用 win32 DLL(用 C 语言
实现)。该应用程序必须正常运行。好吧,我想通过将 DLL 添加到 exe 资源来将 DLL 与 exe 合并。我可以将其添加为二进制流吗?如果没有,如何将 DLL 与应用程序合并?
My app is using a win32 DLL (implemented with C language
). It is necessary for the app to to work. Well, I want to merge the DLL with the exe, by adding the DLL to the exe resources. Can I add it as binary stream? If not, how can I merge the DLL with the app?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
根据上面的评论:
如果 DLL 是本机的,那么您需要将其提取到文件中(例如在 EXE 的开头) - 没有记录/支持的方法可以按照您描述的方式使用本机 DLL...
如果 DLL 是 .NET DLL,那么这将是可能/支持的(通过内存/资源流或字节 [] 将其作为程序集加载)...
As per comments above:
IF the DLL is native then you need to extract it to a file (for example on the start of the EXE) - there is NO documented/supported way for native DLLs to be used the way you describe...
IF the DLL were a .NET DLL then this would be possible/supported (by loading it as an Assembly via a memory/Resource stream or byte[])...
根据 http://www. dotodotnet.com/2010/10/read-embedded-resource-text-file-in-c.html
和 嵌入式二进制资源 - 我如何枚举嵌入图像文件? 您可以将其添加为二进制流等。
然后,您必须将其保存到文件并稍后绑定它,如 http:// www.codeproject.com/KB/cs/dyninvok.aspx
According to http://www.dottodotnet.com/2010/10/read-embedded-resource-text-file-in-c.html
and Embedded Binary Resources - how can I enumerate the image files embedded? You can add it as binary stream and as as such.
Then you have to save it to the file and late bind it as explained in http://www.codeproject.com/KB/cs/dyninvok.aspx