尝试在运行时添加时,资源会自动删除 [英] Resources getting deleted automatically when trying to add at run time

查看:79
本文介绍了尝试在运行时添加时,资源会自动删除的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我在运行时添加资源时遇到问题。旧资源会自动删除。

顺序如下:

1.读取文件的二进制内容。

2。尝试添加到另一个可执行文件的资源部分。

3.资源被添加为BIN1 - > IDR_SAMPLEBIN1等等。

4.经过一些步骤后,先前添加的资源将被删除。

5.在8个周期结束时,我希望资源 BIN1通过BIN8但我发现只有2或3个。



我无法理解可能出现的问题。

我我正在使用BeginUpdateResource(),UpdateResource()和EndUpdateResource()。



非常感谢任何帮助。



谢谢和问候,

Kishor Reddy

解决方案

多次更新资源取代了之前的内容 [ ^ ]。

Hi All,

I am facing a problem in adding resources at run time. The old resources are getting deleted automatically.
The sequence is as follow:
1. Reading the binary contents of a file.
2. Trying to add to resources section of another executable.
3. The resources are being added as "BIN1" -> "IDR_SAMPLEBIN1" and so on.
4. After some steps, the previously added resources are getting deleted.
5. At the end of 8 cycles, i expect resources "BIN1" through "BIN8" but i found only 2 or 3 of them.

I could not understand what could be wrong.
I am using BeginUpdateResource(), UpdateResource() and EndUpdateResource() for the same.

Any help is greatly appreciated.

Thanks and Regards,
Kishor Reddy

解决方案

Same answer as provided at Updating Resources multiple times replaces the earlier contents[^].


这篇关于尝试在运行时添加时,资源会自动删除的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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