Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
Preventing "Can't write" error
In a little program I knocked up, I'm using ini files. When the program closes, it saves some things to the ini file.
By accident, I found that when the program is on an unwritable medium (eg CD), it comes back with an error message along the lines of "Cannot write to INI file", which keeps on coming back, no matter how many times you press OK. The only way I could kill it in the end was to use ProcessExplorer (Not even TaskManager worked).
Can someone suggest to me how I'd get around this error, and replace it with my own (Which would be a single message of "Unable to save settings" and then the program finishes closing)
0 · ·