Hi,
i'm trying to read a bitmap file using the ResourceCreate() function. The file exists in the MQL5\\Files folder so that calling FileIsExist(ImageFileName) returns TRUE.
In contrast, the “ResourceCreate” function returns error 5019 which means that the file does not exist.
I have tried everything possible: Working with absolute paths, putting the file in other folders, etc.
The file cannot seem to be found.
What am I doing wrong?
Here's my code, any help is really appreciated.
Regards,
Chris
https://www.mql5.com/en/book/advanced/resources/resources_resourcecreate#:~:text=ResourceCreate(%22%3A%3AMyImage%22,added%20to%20the%20name%20automatically).
If you are doing everything correct check the formatting of the file is correct. You need to convert the file into an actual .bmp format. Simply renaming and change the formatting might not work.

- www.mql5.com
Hi,
As Muhammad said, using your code, the ea is looking for the resource in the same folder as your code file.
If there is no backslash, then the resource is searched starting from the folder where the executable file from which we call the function is located.
https://www.mql5.com/en/book/advanced/resources/resources_resourcecreate#:~:text=ResourceCreate(%22%3A%3AMyImage%22,added%20to%20the%20name%20automatically).
If you are doing everything correct check the formatting of the file is correct. You need to convert the file into an actual .bmp format. Simply renaming and change the formatting might not work.
That was exactly the reason.
As soon as I reference the file in this way, everything works as intended:
ResourceCreate("test", "\\Files\\" + ImageFileName)
Thank you very much!

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi,
i'm trying to read a bitmap file using the ResourceCreate() function. The file exists in the MQL5\\Files folder so that calling FileIsExist(ImageFileName) returns TRUE.
In contrast, the “ResourceCreate” function returns error 5019 which means that the file does not exist.
I have tried everything possible: Working with absolute paths, putting the file in other folders, etc.
The file cannot seem to be found.
What am I doing wrong?
Here's my code, any help is really appreciated.
Regards,
Chris