AV When Using sDBNavigator With Custom Buttons, v9.16

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #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 10 posts - 1 through 10 (of 10 total)
                      • You must be logged in to reply to this topic.