如何从预编译的dll中删除清单 [英] How do I remove a manifest from a precompiled dll

查看:164
本文介绍了如何从预编译的dll中删除清单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个预编译的c ++ dll,我需要从中删除或替换嵌入式清单.有什么办法可以从命令行执行此操作?我知道可以在VS中打开dll并删除清单,但是如果可能的话,我想使该过程自动化.

I have a precompiled c++ dll that I need to remove or replace the embedded manifest from. Is there a way that I can do this from the command line? I know it is possible to open the dll in VS and simply delete the manifest, but I would like to automate this process if possible.

推荐答案

不幸的是,似乎VS附带的用于处理清单mt.exe的标准工具无法删除它们.但是,如果您熟悉c ++,则可以很容易地为此目的编写自己的工具.

Unfortunately, it seems the standard tool to deal with manifests mt.exe shipped with VS cannot delete them. But if you are familiar with c++ it's quite easy to write your own tool for this purpose.

您只需要致电 BeginUpdateResource (具有给定的dll名称),然后 UpdateResource ,其中lpData = NULL和cbData = 0删除给定的资源类型(RT_MANIFEST),并使用EndUpdateResource提交更改.

You just need to call BeginUpdateResource with given dll name, then UpdateResource with lpData = NULL and cbData = 0 to delete given resource type (RT_MANIFEST) and EndUpdateResource to commit changes.

这篇关于如何从预编译的dll中删除清单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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