位图资源:调试&发布配置 [英] Bitmap Resources : Debug & Release configuration

查看:181
本文介绍了位图资源:调试&发布配置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在dll中有位图资源.在调试配置中使用dll时,我可以加载bitamps.但是,在发布配置中运行时,相同的代码将为LoadBitmap返回错误.资源在发布配置中不可用吗?

I have bitmap resources in dll. When I use the dll in debug configuration, I am able to load the bitamps . However, same code when run in release configuration returns error for LoadBitmap. Are the resources not availale in release configuration? are theere any settings in visual studio or any configuration to make them available?

推荐答案

资源是否可用,可以确定,无论设置如何,都可以使用Visual Studio中的任何设置吗?和配置.
您的问题出在别的地方.您确定要从嵌入式资源加载吗?可能是路径名问题.

您甚至可以在Release配置中调试代码,然后查找问题所在.更好的是(在这种情况下),捕获所有异常并转储异常信息(带有堆栈),以查看引发和传播异常的代码行.如果仍然无法确定解决方案,请发布此转储文件和代码的相关部分.

—SA
Resources are available, for sure, regardless of the settings and configuration.
You problem is somewhere else. Are you sure you''re loading from embedded resource? It can be a path name problem.

You can debug your code even in Release configuration and find where the problem is. Better yet (in this case), catch all the exception and dump exception information (with stack) to see the code lines where the exception is thrown and propagated. If you still cannot figure out the resolution, post this dump and relevant parts of the code.

—SA


代码中没有任何例外,只是LoadBitmap返回0表示资源不可用.
There are no exceptions in code except that LoadBitmap is returning 0 to indicate resource is not available.


这篇关于位图资源:调试&发布配置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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