wxBitmap LoadFile failed please check .rc file 如何解

例如有如下代码

bm.LoadFile(filename, wxBITMAP_TYPE_BMP);

运行时出错。

那么原因可能如下:

  1. filename不是bmp类型。

方法:

将wxBITMAP_TYPE_BMP改成队应类型或者wxBITMAP_TYPE_ANY

另外还要在LoadFile【之前】加载对应驱动,如:

wxImage::AddHandler(new  wxJPEGHandler);  

 wxImage::AddHandler(new  wxPNGHandler);

 wxImage::AddHandler(new  wxGIFHandler);

注意,是wxImage!

2.路径不对

LoadFile默认从当前路径查找文件。当只有一个项目的时候,一般不会出错。

但是如果有一个工程有多个项目的话,当前路径可能在其他地方,那么可以

用如下方法获取当前路径

wxString GetWorkDirectory( )
{
 wxString strAppPath ;
 wxStandardPathsBase& stdp = wxStandardPaths::Get();
 wxFileName exeFile(stdp.GetExecutablePath());
 strAppPath = exeFile.GetPath(wxPATH_GET_VOLUME | wxPATH_GET_SEPARATOR);
 return strAppPath ;
}

如果当前路径不是想要的,那么,则恭喜你,找到错误了。

时间: 2024-10-24 03:15:30

wxBitmap LoadFile failed please check .rc file 如何解的相关文章

ORA-01122: database file 4 failed verification check

现象: 在做表空间恢复演练时,遇到如下错误提示: SQL> alter database datafile 4 online;alter database datafile 4 online      *                                     ERROR at line 1:                      ORA-01122: database file 4 failed verification checkORA-01110: data file

PHP: configure: error: mysql configure failed. Please check config.log for more information.

为php增加mysql模块时报错 configure: error: mysql configure failed. Please check config.log for more information. 解决方法: ./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-mysql-dir=/usr --with- mysqli=/usr/bin/mysql_config -

CentOS 安装软件时,错误Transaction check error ... file...conflicts with file from package zzz的解决

CentOS 安装软件时(比如:# yum install subversion),有时候会碰到类似如下的错误: Transaction check error: file /usr/lib64/libsvn_client-1.so.0.0.0 from install of subversion-1.8.11-1.x86_64 conflicts with file from package subversion-libs-1.7.14-7.el7_0.x86_64 file /usr/lib

ASM ClassReader failed to parse class file - probably due to a new Java class file version that isn

错误产生的信息如下: Caused by: org.springframework.core.NestedIOException: ASM ClassReader failed to parse class file - probably due to a new Java class file version that isn't supported yet: file [E:\develop_tools\apache-tomcat-8.0.18\webapps\SpringMVCUpload

Unity3D 移动MM failed to find resource file{mmiap.xml}解

欢迎来到unity学习.unity培训.unity企业培训教育专区,这里有很多U3D资源.U3D培训视频.U3D教程.U3D常见问题.U3D项目源码,我们致力于打造业内unity3d培训.学习第一品牌. 在进行移动MM集成的时候总是会遇到一个bug:  failed to find resource file(mmiap.xml} 原因是:为Unity打包的时候和原生Android工程不一样,打包好了之后,找不到mmiap.xml解决方法如下:1.使用Unity打包好后.2.使用apkTool解

Spring MVC 单元测试异常 Caused by: org.springframework.core.NestedIOException: ASM ClassReader failed to parse class file

Sping 3.2.8.RELEASE + sping mvc + JDK 1.8运行异常. java.lang.IllegalStateException: Failed to load ApplicationContext at org.springframework.test.context.CacheAwareContextLoaderDelegate.loadContext(CacheAwareContextLoaderDelegate.java:99) at org.springfr

ubuntu下vagrant up经常出现Failed to upload a file to the guest VM via SCP due to a permissions error.最终解决

? /vagrant vagrant reload [default] Attempting graceful shutdown of VM... [default] Clearing any previously set forwarded ports... [default] Clearing any previously set network interfaces... [default] Preparing network interfaces based on configurati

ASM ClassReader failed to parse class file - probably due to a new Java class file version that isn't supported yet

1. 问题描述 tomcat启动项目 报错如上,ide是eclipse,jdk安装的是jdk8. 2. 解决方案 可能原项目是用jdk7或其他版本开发的,错误提示也很清晰,更换jdk编译一下 项目右键-->build path-->Configure build path-->Project facets 再重新发布 启动好了 ASM ClassReader failed to parse class file - probably due to a new Java class fil

Caused by: org.springframework.core.NestedIOException: ASM ClassReader failed to parse class file

最近在琢磨maven,自己照着网上的例子塔了一个例子,在junit测试时报错了,详细错误信息: org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class: file [D:\workspace\MAVEN\example_1\target\classes\cn\springmvc\service\impl\UserServiceImpl.clas