Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export source from Ribbon: frmVCSMain does not stay open if ErrorLevel > eelWarning (AutoClose) #494

Open
josef-poetzl opened this issue Mar 13, 2024 · 2 comments
Labels
pending resolved Possibly resolved, needs testing or confirmation

Comments

@josef-poetzl
Copy link

When Export Source is started from the ribbon, the main form does not remain open despite an error message.
AutoClose is always triggered.

Cause: Log.ErrorLevel is always 0, as the log instance in the export methods is destroyed.
see: josef-poetzl@6cdb15b

Fix:
josef-poetzl@36948e5

@joyfullservice
Copy link
Owner

@josef-poetzl - Thanks for pointing this out! I like the concepts you implemented in the suggested fix. But as I dug into it a little deeper, I think I found an underlying issue that may solve this in an even more elegant way.

As you pointed out the Log instance is destroyed by the call to ReleaseObjects. Stepping through the code, this actually happens twice, once as the export finishes, and a second time as the clsVersionControl class is terminated.

Ideally, I would like to persist the log object during the duration of the entire operation triggered by the ribbon button click. This will allow the form UI code to check the Log.ErrorLevel after the conclusion of the export, but before the form is closed. When the clsVersionControl class terminates at the conclusion of the entire operation, the objects are released. I believe that by removing the redundant (early) calls to ReleaseObjects, we can resolve this issue.

joyfullservice added a commit that referenced this issue Mar 20, 2024
This caused some undesirable behavior when the main form could not check the value of the ErrorLevel at the conclusion of the export operation. #494
@joyfullservice joyfullservice added the pending resolved Possibly resolved, needs testing or confirmation label Mar 20, 2024
@josef-poetzl
Copy link
Author

josef-poetzl commented Mar 20, 2024

Tested: works fine

I still made this adjustment:
josef-poetzl@ea1a37e
=> to allow add enum items between Warning and Error
Note: This is a test branch where I test the interface for AccUnit - with minimal customization of the msaccess-vcs-addin.
(see: #493)

Screenshot of example log:
https://www.access-programmers.co.uk/forums/attachments/msaccess-vcs-testfailedwarning-png.113036/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pending resolved Possibly resolved, needs testing or confirmation
Projects
None yet
Development

No branches or pull requests

2 participants