Posted By: Aku_Aku
Handling E1115 error (and others...) inside the program - 04/07/13 16:39
My application shows various external images picked up from hard disk.
Unfortunately, sometimes a file has bad format.
In this case i would like that if the program doesn't pop up a silly message and dies immediatly after hitting the enter key.
In my dreams, my lite-c code would handle such cases, would show own message, and wouldn't die.
Just continue the work.
What should i write in my code to do this?
Thanks in advance.
Posted By: sivan
Re: Handling E1115 error (and others...) inside the program - 04/08/13 09:10
maybe it can help you:
if the error happens on image loading/creation:
set warn_level to 0, in theory it surpresses all error messages.
if the error message happens on image manipulation:
you can get the image format by bmap_lock and use bmap_to_format to convert them to a suitable format, like 888 or 8888 from dds for pixel manipulations.
Posted By: Uhrwerk
Re: Handling E1115 error (and others...) inside the program - 04/08/13 13:59
I don't think setting warn_level to 0 will suppress error messages, only warnings. But try it anyways!
Posted By: Aku_Aku
Re: Handling E1115 error (and others...) inside the program - 04/08/13 17:41
Thanks for the idea, i will try it.
Posted By: Ch40zzC0d3r
Re: Handling E1115 error (and others...) inside the program - 04/08/13 19:36
My way:
Hook MessageBoxA and read the error (split it down to one or two words) and use a simple if condition to filter the msg. You can also block the msgbox if you dont call the orig function!
This method works 100%
Posted By: Aku_Aku
Re: Handling E1115 error (and others...) inside the program - 04/09/13 18:02
Sivan, warn_level=0 didn't help.
The issue is the same.
Posted By: fogman
Re: Handling E1115 error (and others...) inside the program - 04/09/13 21:52
How do you load the image (which lite-c function do you use)?
Posted By: fogman
Re: Handling E1115 error (and others...) inside the program - 04/10/13 06:46
I´ve had the same problems in past. Do you have the error only with specific file extensions, like tga? In this case, you could try to use
bmap_load(BMAP*,char* name,var mode)
for these extensions.
Posted By: Aku_Aku
Re: Handling E1115 error (and others...) inside the program - 04/11/13 16:47
The file extension is irrelevant, i can have tga files with bga, txt, tundra, werewolf or chips or other extensions.
Naturally, i tried the bmap_load, it gives E2000.
Posted By: Aku_Aku
Re: Handling E1115 error (and others...) inside the program - 04/14/13 11:00
Ch40zzC0d3r could you explain how should implement your proposal?
Hook MessageBoxA and read the error (split it down to one or two words) and use a simple if condition to filter the msg. You can also block the msgbox if you dont call the orig function!
This method works 100%