This issue only occurs when the parent of the file in question has been moved or removed.
To reproduce:
- Create a test file "test.txt" in a new folder "Test".
- Open the file in OWLMaker.
- Observe that the MRU list on the File menu now includes "test.txt".
- Delete the "Test" folder.
- In OWLMaker, select "test.txt" from the MRU list on the File menu.
- Message box is shown: "File '...' doesn't exist. Create it?" (Yes/No).
- Select Yes.
- Observe the following:
- Build 8642 (latest release): Crash; no message, just immediate shutdown.
- Build 7704 and 7498: "Unable to read file '...' from disk" shown twice, followed by empty editor titled "File - Untitled".
- Build 7349-6049: Same behaviour, but message shown once only.
Proposed resolution
If the parent folder of the MRU file is not valid, do not ask the user whether to recreate the file. Just show a message informing the user that the file no longer exists, and just remove the MRU entry.
It seems to me part of the problem is that this code is buried too deep in the DocView framework and does not allow user code an easy way to catch and handle the exceptions.
Thus, DocView should handle all these errors gracefully and not throw unhandled exceptions that would bring the whole application down.
Or there should be some easy mechanism that would allow user code to be notifed and for it to decide how to handle the error condition.
@jogybl wrote:
While the exception handling within DocView may be poor and need improvement, the faulty logic for this particular problem is implemented in TOWLMakerApp::CmOpenRecentFile.
Draft proposed fix (not tested):
Last edit: Vidar Hasfjord 38 seconds ago