Appearance
TExecuteCallBackEvent
The asynchronous functions require you to pass in a "call back" procedure defined as TExecuteCallBackEvent in the DLL interfaces.
csharp
C#
public delegate void TExecuteCallBackEvent(string ActionFID, bool Success);pascal
Delphi
Type TExecuteCallBackEvent = procedure(ActionFID : PChar; Success : boolean) of object;You must define a procedure within your application that matches the definition of TExecuteCallBackEvent, then pass a pointer to this procedure as a parameter to the Asynchronous functions.
When FlowAPI completes the execution of the action it calls your "call back" procedure. This allows you to perform further processing in your application based on the completion of the Action within FlowAPI.
Defining TExecuteCallBackEvent
The following are some sample definitions of your "call back" procedure
csharp
C#
public void ExecuteCallBackHandler(string ActionFID, bool Success)
{
if (Success) MessageBox.Show("Action has executed successfully"); else MessageBox.Show("Action has failed to execute");
}pascal
Delphi
procedure ExecuteCallBackHandler(ActionFID: PChar; Success: boolean);
begin
if Success then
ShowMessage('Action has executed successfully')
else
ShowMessage('Action has failed to execute');
end;Passing TExecuteCallBackEvent as parameter to function call.
The following are some samples showing how your "call back" procedure is passed as a parameter to a function.
pascal
C#
TExecuteCallBackEvent ExecuteCallBack = new TExecuteCallBackEvent(ExecuteCallBackHandler); //create delegate using above handler
FlowAPI.Flo_ExecuteAction("123", ExecuteCallBack); //pass delegate to functionpascal
Delphi
Flo_ExecuteAction(PChar(aFID), ExecuteCallBackHandler); //pass reference to call back procedure directly to function