Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Non blocking message dialog MessageDialogAsync



Permlink Replies: 2 - Last Post: Jul 13, 2017 11:31 AM Last Post By: duf _ Threads: [ Previous | Next ]
duf _

Posts: 28
Registered: 7/2/06
Non blocking message dialog MessageDialogAsync
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 13, 2017 2:28 AM
How to use this MessageDialogAsync in this way that user can choose answer after the display question?
MessageDialogAsync does not stop process of executing next instruction after this dialog

if ( TPlatformServices::Current->SupportsPlatformService(__uuidof(IFMXDialogServiceAsync), &_dialogservice) )
	_dialogservice->MessageDialogAsync("Choose a button:", TMsgDlgType::mtInformation, TMsgDlgButtons() << TMsgDlgBtn::mbYes << TMsgDlgBtn::mbNo, TMsgDlgBtn::mbNo, 0, handler);
 
// in this place instruction is execution without wait for above question
 
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: Non blocking message dialog MessageDialogAsync
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 13, 2017 9:52 AM   in response to: duf _ in response to: duf _
duf _ wrote:

How to use this MessageDialogAsync in this way that user can choose
answer after the display question? MessageDialogAsync does not stop
process of executing next instruction after this dialog

You are displaying an asynchrounous dialog, so it is NOT going to
block the calling code, by design.

What you are looking for is clearly a synchronous dialog, but that
does NOT work on Android. You need to rework your code design to run
asynchronously, there is no getting around that on Android. You are
already passing a handler to the dialog's CloseDialog event, any code
that depends on the result of the dialog must be inside that handler.

--
Remy Lebeau (TeamB)
duf _

Posts: 28
Registered: 7/2/06
Re: Non blocking message dialog MessageDialogAsync
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 13, 2017 11:31 AM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Remy Lebeau (TeamB) wrote:
duf _ wrote:

How to use this MessageDialogAsync in this way that user can choose
answer after the display question? MessageDialogAsync does not stop
process of executing next instruction after this dialog

You are displaying an asynchrounous dialog, so it is NOT going to
block the calling code, by design.

What you are looking for is clearly a synchronous dialog, but that
does NOT work on Android. You need to rework your code design to run
asynchronously, there is no getting around that on Android. You are
already passing a handler to the dialog's CloseDialog event, any code
that depends on the result of the dialog must be inside that handler.

--
Remy Lebeau (TeamB)
Thank You
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02