- This topic has 10 replies, 2 voices, and was last updated 10 years, 5 months ago by
tmorris.
-
AuthorPosts
-
October 15, 2014 at 4:24 pm #36320
tmorris
ParticipantThis 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).
October 15, 2014 at 5:25 pm #52601Support
KeymasterHello, thank you for the message.
Try attached file, the error is fixed there.
October 15, 2014 at 8:25 pm #52604tmorris
ParticipantThanks. 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.
October 15, 2014 at 10:03 pm #52605tmorris
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!
October 15, 2014 at 10:04 pm #52606tmorris
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.)
October 15, 2014 at 10:19 pm #52607tmorris
ParticipantAlso, 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.
October 22, 2014 at 3:26 pm #52644Support
KeymasterYou are right, resources are duplicated. Will be removed soon.
October 23, 2014 at 10:16 pm #52674tmorris
ParticipantJust confirming. Above issues appear to be resolved in v9.17. Thanks!
October 29, 2014 at 9:46 pm #52690tmorris
ParticipantI'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.
November 3, 2014 at 10:47 am #52693Support
KeymasterThank you for the demo, try this patched file, please.
November 3, 2014 at 11:11 pm #52703tmorris
Participant'Support' wrote:Thank you for the demo, try this patched file, please.
Yes that works. Thanks.
-
AuthorPosts
- You must be logged in to reply to this topic.