CEikonEnv::Static()-CreateBitmapL() leaves with the error code -1001
Article Metadata
Compatibility
S60 2nd Edition
Article
Overview
CEikonEnv::Static()-CreateBitmapL() leaves with the error code -1001
Description
When trying to use CEikonEnv::Static()->CreateBitmapL() and opening the file fails, the function leaves always with the error code -1001 regardless of the reason of the error (for example, "file not found" or "out of memory"). How can I find out whether the error was "file not found" or something else?
Solution
If the reason for the file system error is needed, the CWsBitmap::Load() function can be used instead of CreateBitmapL(). It returns system-wide error codes in case of an error. CEikonEnv uses the CWsBitmap::Load() function to load a bitmap but leaves in case of an error. The idea behind the leave is to provide an error text using an error resolution API. There is a difference in the filename parameter of Load() and CreateBitmapL() functions. The former can only use absolute filenames.


(no comments yet)