AV When Using sDBNavigator With Custom Buttons, v9.16

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #36320
    tmorris
    Participant

    This error appears to be introduced in the 9.16 version.

    Drop an sDBNavigator onto a form and uncheck one of the VisibleButtons. Now if you try to run the application or reload the form at design time you will get an AV.

    It appears the InitButtons procedure was moved to the CreateWnd procedure that does not get called before SetVisible is called. This is where the AV occurs (the buttons in the Buttons array have not been created).

    #52601
    Support
    Keymaster

    Hello, thank you for the message.

    Try attached file, the error is fixed there.

    #52604
    tmorris
    Participant

    Thanks. That fixed that issue. However it looks like you have the same issue with the InitHints procedure. If any of the button hints are changed from default you get an AV in the InitHints as the buttons array has not yet been initialized.

    #52605
    tmorris
    Participant
    'Support' wrote:

    Hello, thank you for the message.

    Try attached file, the error is fixed there.

    Also ran into the same issue where the button array of objects are not initialized in the DataChanged procedure. Attached is a demo of where the dataset datachanged event is triggering before the buttons are initialized in the CreateWnd procedure. It throws an AV.

    You might want to check all the code in sDBNavigator that references the Buttons array (now that it has been moved out of the navigator object's Create constructor ) and make sure that procedures that might be invoked prior to the CreateWnd procedures are not referencing null objects.

    Good luck!

    #52606
    tmorris
    Participant
    'tmorris' wrote:

    Also ran into the same issue where the button array of objects are not initialized in the DataChanged procedure. Attached is a demo of where the dataset datachanged event is triggering before the buttons are initialized in the CreateWnd procedure. It throws an AV.

    You might want to check all the code in sDBNavigator that references the Buttons array (now that it has been moved out of the navigator object's Create constructor ) and make sure that procedures that might be invoked prior to the CreateWnd procedures are not referencing null objects.

    Good luck!

    (Sorry, keep forgetting to hit attach.)

    #52607
    tmorris
    Participant

    Also, just an annoyance with the sDBNavigator unit. Is it necessary to explicitly load the DBCtrls.res resource? I keep getting duplicate resource warnings with this in there:

    {$IFDEF DELPHI_XE2}

    {$R DBCtrls.res}

    {$ENDIF}

    I know it was added when the code for using the vanilla button icons was added. I guess there might be cases where they are not loaded and then need to be loaded explicitly?

    Thanks.

    #52644
    Support
    Keymaster

    You are right, resources are duplicated. Will be removed soon.

    #52674
    tmorris
    Participant

    Just confirming. Above issues appear to be resolved in v9.17. Thanks!

    #52690
    tmorris
    Participant

    I'm sorry. Spoke too soon. There is still an issue of the buttons array being referenced before being created. Attached is an example of a sDBNavigator not visible but attached to a dataset. It is on the second tabsheet. Pressing insert record triggers the dataset to tell all the attached controls to update. However since the 'hidden' sDBnavigator has not been initialized (buttons/hints?) it throws an AV. The AV is thrown in the TsDBNavigator.EditingChanged procedure.

    #52693
    Support
    Keymaster

    Thank you for the demo, try this patched file, please.

    #52703
    tmorris
    Participant
    'Support' wrote:

    Thank you for the demo, try this patched file, please.

    Yes that works. Thanks.

Viewing 11 posts - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.