Jump to content

MessageDlg calback overload


Pier

Recommended Posts

Can MessageDlg be modified in such a way that the Callback function is not

procedure EditCallback(Sender: TComponent; res :Integer);

but

procedure EditCallback(Sender: TComponent; DataSet: TDataSet;res :Integer);

in other words I would like to pass some other stuff to the callback

Link to comment
Share on other sites

  • 10 months later...
procedure TfmmClientsDataEdit.TreeTriggerCallbackAnonProc(Sender: TComponent; Res: Integer);
Var
  
  fmmSelFromTree: TfmmSelFromTree;
  
  ds: TDataSet;
begin
  if Res <> mrOk then exit;

  if Sender is TfmmSelFromTree then
    fmmSelFromTree := Sender as TfmmSelFromTree
  else
    exit;

  ds := fmmSelFromTree.MyDataSet1;
end;

 

Link to comment
Share on other sites

Thanks for the help but this is not what is needed in my case. I want a single function to handle all datasets not just one (like MyDataSet1 in your example).

The problem is that the Sender is the MainForm and not the DataSet which called the MessageDlg which then invoked the callback...

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...