This is a really interesting error indeed :) I have a child form inheriting from a base form. The base form provides all sorts of virtual;abstract; services for use by children. This form uses all of them :) one of the services is a Save/Cancel system, which is coded in this way in the base form:
procedure TBaseRecordFrm.ConfirmSave(AVal: Boolean); begin if AVal then PerformSave else PerformCancel; Close; end;
The inherited form does something quite simple: in the Ok and Cancel button calls ConfirmSave with the appropriate parameter(True/False). The code for the two methods is pretty straight-forward:
procedure TActionFrm.PerformCancel; begin if DMMain.CDSActionItems.State in dsEditModes then DMMain.CDSActionItems.Cancel; end; procedure TActionFrm.PerformSave; begin if DMMain.CDSActionItems.State in dsEditModes then DMMain.CDSActionItems.Post; end;
When pressing "Cancel", I get a "Privileged Instruction" exception. I am not doing anything spectacular as far as I can see. Anybody can shed some light, please? :)
Thank you!
Andrea