Wxbitmap LoadFile failed please check. rc file how to solve

Source: Internet
Author: User

For example, the following code

Bm. LoadFile (filename, wxbitmap_type_bmp);

A run-time error occurred.

The reasons may be as follows:

    1. FileName is not a BMP type.

Method:

Change wxbitmap_type_bmp to Team type or Wxbitmap_type_any

Also load the corresponding driver before the LoadFile "before", such as:

Wximage::addhandler (new Wxjpeghandler); Wximage::addhandler (new Wxpnghandler); Wximage::addhandler (new Wxgifhandler);

Attention, it's wximage!.

2. Path is not correct

LoadFile default to find files from the current path. When there is only one item, there is usually no error.

However, if there is a project with multiple projects, the current path may be elsewhere, then you can

Get the current path in the following way

Wxstring getworkdirectory () {wxstring strapppath; wxstandardpathsbase& STDP = Wxstandardpaths::get (); WxFileName ex Efile (STDP. Getexecutablepath ()); Strapppath = Exefile.getpath (Wxpath_get_volume | wxpath_get_separator); return Strapppath;}

If the current path is not desired, then congratulate you and find the error.

Wxbitmap LoadFile failed please check. rc file how to solve

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.