Delphi FMX button calling a dll form dosent wait till the form is finished with before exiting routone -
i have dll creates form , uses strings passed set variables database connections. works fine. problem on main form need refresh db tables when dll form closed. how do this.
my dll
library contact; uses system.sysutils, system.classes, fmx.forms, newcontact in 'newcontact.pas' {fmnewcontact}; {$r *.res} procedure newcontactshow(title: string; table: string; connection: string; param: tstrings); stdcall export; begin fmnewcontact := tfmnewcontact.create(nil); // creates form fmnewcontact.tablename := table; fmnewcontact begin caption := title; fdconnect.connectionname := connection; fdconnect.params.text := param.text; fdconnect.connected := true; saved := false; //flag form new data has been saved db table; show; end; end; function getstatus(): boolean; begin result := fmnewcontact.saved; // status of flag before destroying form. fmnewcontact.destroy; end; exports newcontactshow, getstatus; begin end.
in main form
procedure tform1.newbttnclick(sender: tobject); begin try // creates form , displays in fine. newcontactshow('enter new employee', 'employee', fdtimecard.connectionname, fdtimecard.params); // destroys form before user can deal if getstatus buildemployeetable(); end; end;
if remove getstatus check tables updated prior user entering infomation on dll form
so goal is
i need call dll form. wait till user saved data on form. update table on screen.
Comments
Post a Comment