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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...