Closed ray-tmsk closed 6 years ago
Does the XE7 build work for this user? Which Windows versions does this user use?
It would be good to have a more detailed call stack like it is provided by MadExcept or EurekaLog.
Yes, xe7 build work. User work in latest server 2016
No experiments with call stack. But it must be standard. Try to raise exception instead of framework.loadui
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.
I noticed the ribbon always fails to load its resource when the form starts in wsMaximized state.
We are using 10.2.3 as well and so far could not see this behavior. I just tried the included sample project 07 Text Pad with Action List
, set the WindowState
property to wsMaximized
and run the program. I could not see any failure. I used the latest source from this repository.
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! Now I can reproduce trouble too. Easy to fix while see it. One question remains: why xe7 project work?
Writing WindowState := wsMaximized in FormCreate does. In the sample project too.
Confirmed.
TCustomForm.SetWindowState()
calls RecreateWnd()
, however the csRecreating is missing in TCustomForm.ControlState
. So the test for this flag in TUIRibbon.CreateWnd()
brings an unexpected result. The flag might have been correctly inlcuded in XE7.
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.