Bug Report T189719
Visible to All Users

Ribbon - An AV occurs when opening a form or pressing Alt+F12 to switch the form back from the text view when the form contains the Ribbon with unassigned BarManager property

created 10 years ago

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:

  1. Open a new project
  2. Create a form
  3. Place a TdxRibbon
  4. Press Alt+F12 (goes to the dfm)
  5. Press Alt+F12 (goes back to the form, causing the components to be (re)created)
  6. 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;

Comments (1)
DevExpress Support Team 10 years ago

    Hello Dimitar,

    Thank you for your detailed report. I have reproduced the described behavior and forwarded this ticket to our developers for research.

    Answers approved by DevExpress Support

    created 10 years ago (modified 10 years ago)

    We have fixed the issue described in this ticket and will include the fix in our next maintenance update. To apply this solution before the official update, request a hotfix by clicking the corresponding link for product versions you require.

    Note: Hotfixes may be unavailable for beta versions and updates that are about to be released.

      Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

      Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.