If you place a dxRibbon on a form, but do not assign a BarManager, once you reopen the form you get:
[Window Title]
Error
[Content]
Error creating form: Access violation at address 1D35235F in module 'dxBarRS20.bpl'. Read of address 00000158.
[OK]
Steps to reproduce:
- Open a new project
- Create a form
- Place a TdxRibbon
- Press Alt+F12 (goes to the dfm)
- Press Alt+F12 (goes back to the form, causing the components to be (re)created)
- You get the above mentioned AV
If you connect a BarManager to the Ribbon the problem disappears.
Reason:
procedure TdxCustomRibbon.Loaded;
begin
BeginUpdate;
try
Tabs.UpdateBarManager(BarManager);
inherited Loaded;
ActiveTab := FLoadedActiveTab;
if ActiveTab <> nil then
ActiveTab.CheckGroupToolbarsDockControl;
Tabs.RestoreOrder;
Tabs.UpdateContexts;
BarManagerSaveState; { <--- THIS LINE IS NEW in this release; obviously it doesn't check that there's no bar manager}
finally
EndUpdate;
end;
end;
Better solution is to check here:
procedure TdxCustomRibbon.BarManagerSaveState;
begin
TdxBarManagerAccess(BarManager).SaveState; { <<-- NO CHECK THAT BARMANAGER CAN BE NIL }
end;
Hello Dimitar,
Thank you for your detailed report. I have reproduced the described behavior and forwarded this ticket to our developers for research.