This issue occurs when the recreation of the file fails. For example, the parent of the file in question has been moved or removed, or the user has no write permission to the folder.
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 (barely tested):
See "Exceptions and OWLNext | Exceptions in event handlers".
Last edit: Vidar Hasfjord 2026-08-13
Fix looks good.
By the way, the reason no message box is shown in the latest release (build 8642) is that the overhauled version of TCoolEdit attempts to save its configuration during stack unwinding after the internal exception caused by the failure to open the MRU file (after the failure to recreate it).
At that point, the editor’s state has already been torn down. In particular, GetApplication returns nullptr inside GetConfigFile_, which leads to a memory access violation and immediate shutdown before any diagnostic dialog can be shown.
This unwinding problem would be indirectly resolved by fixing [bugs:#645], i.e. by not saving the configuration on editor close but instead saving it immediately when configuration changes occur.
Related
Bugs: #645
@jogybl wrote:
Super! While preparing the patch, I noticed that OWLMaker produces warnings in TSourceCodeDownloadDlg::Find and TClearOutputFoldersDlg::Find ("C4458: declaration of 'TMyClass' hides class member"). The same warning has been circumvented in TOWLMakerApp::Find, so for consistency, you may want to use the same workaround to eliminate the remaining warnings as well.
Note that these ugly workarounds can be eliminated if the OWLNext base classes are rewritten without response table macros as well (a change that has been implemented throughout Owlet).
PS. There is a new conversion warning on the OWLNext trunk as well that should be eliminated, assuming you still go for clean builds [feature-requests:#248].
Related
Feature Requests: #248