Closed Nick74k closed 6 years ago
I can replicate the crash, I analyzed it in the IDE, however the call stack does not show any code from Delphi side:
:0fe461ee` ; C:\WINDOWS\SysWOW64\UIRibbon.dll
:0fe794e6 ; C:\WINDOWS\SysWOW64\UIRibbon.dll
:0fe50668 ; C:\WINDOWS\SysWOW64\UIRibbon.dll
:0fe50799 ; C:\WINDOWS\SysWOW64\UIRibbon.dll
:0fe5037a ; C:\WINDOWS\SysWOW64\UIRibbon.dll
:0fe542d3 ; C:\WINDOWS\SysWOW64\UIRibbon.dll
:5a8817f6 ; C:\WINDOWS\SysWOW64\atlthunk.dll
:774ce0bb USER32.AddClipboardFormatListener + 0x4b
:774d8849 ; C:\WINDOWS\SysWOW64\USER32.dll
:774db145 ; C:\WINDOWS\SysWOW64\USER32.dll
:774c8503 ; C:\WINDOWS\SysWOW64\USER32.dll
:774c8aa0 ; C:\WINDOWS\SysWOW64\USER32.dll
:778a0bad ntdll.KiUserCallbackDispatcher + 0x4d
:774bb95b USER32.SendMessageW + 0x5b
:0fe7b911 ; C:\WINDOWS\SysWOW64\UIRibbon.dll
:774ce0bb USER32.AddClipboardFormatListener + 0x4b
:774d8849 ; C:\WINDOWS\SysWOW64\USER32.dll
:774daed1 ; C:\WINDOWS\SysWOW64\USER32.dll
:774c8e1c ; C:\WINDOWS\SysWOW64\USER32.dll
:774c8c20 USER32.DispatchMessageW + 0x10
:0062f790 ; D:\Projects\RibbonFramework\Designer\Bin\RibbonDesigner.exe
I don't think that there is an error in our wrapper. My best guess is that you are doing something that is not supported in the Windows Ribbon Framework. If you manage to replicate the problem with our sample project D:\Projects\RibbonFramework\Samples\High Level\07 Text Pad with Action List\TextPad.dproj
that would be a good start for further analysis.
Also I can't set application mode at program start without flickering
Please don't mix separate issues but open a new issue for this problem.
If you manage to replicate the problem with our sample project Text Pad with Action that would be a good start for further analysis.
That's easy - open project, select any tab (I took CmdTabView) and set Application modes = (all). Then try to select application mode 1 (Without 0) at preview. Trying to set empty mode also gives empty ribbon and crashes after any other mode changes. Seems to be that '(all)' must be avoided at any cost.
Please don't mix separate issues but open a new issue for this problem.
Ok, created another issue
That's easy - open project, select any tab (I took CmdTabView) and set Application modes = (all). Then try to select application mode 1 (Without 0) at preview.
I have one button with OnClick
code:
Ribbon.ApplicationModes := [0..31];
Another button with:
Ribbon.ApplicationModes := [1];
I pressed the first button, then the second button. Worked as expected, no exception. Can you please post or attach your exact code?
Can't reproduce with one change. Strange. May be file was already changed before. However reproduced with two. CmdTabView changed to 'All', CmtTabPrintPreview - to '2' with all it groups too. XML for Samples\High Level\07 Text Pad with Action List\Ribbon is attached.
The exception seems to occur when switching away from an application mode that had no ribbon bar enabled. I can reproduce it with original code by switching to application mode 9 and then back to 0.
The call stack does not include any of our units and looks like this:
:0ff261ee ; C:\WINDOWS\SysWOW64\UIRibbon.dll
:0ff594e6 ; C:\WINDOWS\SysWOW64\UIRibbon.dll
:0ff30668 ; C:\WINDOWS\SysWOW64\UIRibbon.dll
:0ff30799 ; C:\WINDOWS\SysWOW64\UIRibbon.dll
:0ff3037a ; C:\WINDOWS\SysWOW64\UIRibbon.dll
:0ff342d3 ; C:\WINDOWS\SysWOW64\UIRibbon.dll
:6d0217f6 ; C:\WINDOWS\SysWOW64\atlthunk.dll
:7585e0bb USER32.AddClipboardFormatListener + 0x4b
:75868849 ; C:\WINDOWS\SysWOW64\USER32.dll
:7586b145 ; C:\WINDOWS\SysWOW64\USER32.dll
:75858503 ; C:\WINDOWS\SysWOW64\USER32.dll
:75858aa0 ; C:\WINDOWS\SysWOW64\USER32.dll
:776f0bad ntdll.KiUserCallbackDispatcher + 0x4d
:7584b95b USER32.SendMessageW + 0x5b
:0ff5b911 ; C:\WINDOWS\SysWOW64\UIRibbon.dll
:7585e0bb USER32.AddClipboardFormatListener + 0x4b
:75868849 ; C:\WINDOWS\SysWOW64\USER32.dll
:7586aed1 ; C:\WINDOWS\SysWOW64\USER32.dll
:75858e1c ; C:\WINDOWS\SysWOW64\USER32.dll
:75858c20 USER32.DispatchMessageW + 0x10
Vcl.Forms.TApplication.ProcessMessage(???)
I don't think that there is an error in our code or that we can do anything about this in our code. But it shouldn't be too difficult to avoid the situation that no ribbon bar is visible in your code.
Oh, I understood. [All] really means - "Any mode set, which includes 0 mode". So, [all] = [0]. It will be showed in [0,1,2], [0,10], but will not in [1,2], or [5,10]. May be it's worth to update logic of preview application to ensure that empty ribbon will not be shown, if it raises an exception/crash.
No, I don't think it is about the zero ribbon. My guess is that the exception occurs if app mode was set so that no ribbon band at all was visible, and then another app mode is set.
So we have two problems.
First tab set to 0 mode, second to 1 mode, third to [all]. First block on every tab set to tab mode, all other - to [all]. Look what happens at changing mode from [0,1] to [1] - [all] tabs and blocks become invisible..
to [all]
Do you mean [0..31]
?
Look what happens at changing mode from [0,1] to [1] - [all] tabs and blocks become invisible..
I cannot confirm. I copied your XML to Samples\High Level\07 Text Pad with Action List\Ribbon\
, compiled it, compiled and run the application. I have these 3 buttons that I pressed in the given order:
procedure TFormMain.btn3Click(Sender: TObject);
begin
Ribbon.ApplicationModes := [0,1];
end;
procedure TFormMain.btn4Click(Sender: TObject);
begin
Ribbon.ApplicationModes := [1];
end;
procedure TFormMain.btn5Click(Sender: TObject);
begin
Ribbon.ApplicationModes := [0..31];
end;
That's the result:
May be this is a problem of internal preview of ribbon designer? I used it, I didn't compile anything.
May be this is a problem of internal preview of ribbon designer?
Have you tried if the final compiled application behaves the same way as the ribbon designer, or correctly?
Any feedback if the final compiled application shows the problem too?
Trying to set application mode to [30] causes my program to show hidden ribbon despite of the existance of tab with [all modes] visibility. Default preview of ribbon designer crushes at this action (Change mode to [0,30], then [30], then [0,30] again). Changing tab TAB_REG visibility to [0,30] removes this error. Example attached. Is it unsafe to set [All modes]? Or may be it is unsafe to use appmodes without mode 0? Ribbon.zip