-
Notifications
You must be signed in to change notification settings - Fork 59
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
Setting WindowState to wsMaximmized in TForm.OnCreate event causes exception #95
Comments
Does the XE7 build work for this user? It would be good to have a more detailed call stack like it is provided by MadExcept or EurekaLog. |
Yes, xe7 build work. No experiments with call stack. |
The same thing happened to me after upgrading from XE3 to 10.2.3. I noticed the ribbon always fails to load its resource when the form starts in wsMaximized state. I had to switch back to wsNormal, and maximize the form in its OnShow event. That solved the problem for me. |
We are using 10.2.3 as well and so far could not see this behavior. I just tried the included sample project Can you please try if you are able to replicate the issue with this sample project? |
OK, it seems, I was wrong. Setting WindowState to wsMaximized in the IDE does not cause an error. Writing WindowState := wsMaximized in FormCreate does. In the sample project too. I use a component to restore the form's previous state when starting the program. This component sets WindowState programmatically if needed. My forms always failed to open when they were closed in maximized state on the previous run. What I actually did was that I've rewritten the component's code preventing it to save the wsMaximized state, so the forms were always reloaded in wsNormal state. Then I maximized them in OnShow if it was necessary. In my previous comment I oversimplified things. Sorry. :) |
Bingo! Thank you Smile64! |
Confirmed. |
|
- Separated creation and initialization of the ribbon framework. Constructor will now only perform non UI/handle related initialization of the framework - Load() will now call HandleNeeded before passing the parent form's handle to FFramework.Initialize. That way, recreating the window handle of the form no longer causes issues - ApplicationModes are now restored when recreating the window handle
I have application on Delphi XE7 with ribbon, all OK. Now time for switch to xe 10.2.3.
One user can not use application after then (compiled with xe 10.2.3)
Exception on start "An error occurred while trying to load Ribbon resource "APPLICATION" ....(80004005)
I can not reproduce problem on my computers. In user computer xe7 build work - xe10 build no.
I may provide both builds for test.
Now need good way for hide this exception and provide usual toolbars instead of ribbon. Will be good if TUIRibbon.Load() not generate exception. Because now exception was generated via internal calls (CMVisibleChanged->UpdateControlState->UpdateShowing->CreateHandle->CreadeWnd,Load)
Not easy to catch such exception...
I think setting FLoaded := False in TUIRibbon.Load() will enough for detecting that troubles with ribbon loading.
The text was updated successfully, but these errors were encountered: