08-08-2016 02:20 AM
Hello,
I have found out a little weird failure. Now I would like to now if this is normal.
In my application I would like to open simply a file to read.
FILE *fp=NULL;
fp = fopen (g_FileName, "r");
if(fp == NULL)
MessagePopup("Error","File can not be loaded.");
But now I found something out. When I delete my file out of directory and would like to opend the file, the error "File can not be loaded" should pop up. But my compiler stops by the fopen command and shows me the failure in the following. When I press then "countinue" I get the failure "File can not be loaded".
How can I stop this failure of the compiler is this normal?
Best regards
Solved! Go to Solution.
08-08-2016 03:34 AM
yes, this is 'normal', i.e., expected. You can bypass it in three ways:
- not use the debug version (actually it is the debugger reporting, not the compiler) but the release configuration
- uncheck Run / Break On / Library Errors,
- or add DisableBreakOnLibraryErrors() / EnableBreakOnLibraryErrors() before and after the failing command.
08-08-2016 03:44 AM
Thank you.
Where can I set the first option in the program?
Kind regards
08-08-2016 03:48 AM
Build / Configuration
But it would not be my recommended way because you should be happy about the debugger assisting you during program development. Turning it off will also not show other warnings. I would just keep everything as it is - you have to click twice on a button during program development but now you know why, and that the debugger warning automatically will disappear once you build your release executable.
08-08-2016 03:50 AM
You are right. I tried the .exe data and there is no failure.
Thanks a lot. 🙂
08-08-2016 04:03 AM
You are welcome - I also learned a lot in this forum!