Watch, Follow, &
Connect with Us

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


Welcome, Guest
Guest Settings
Help

Thread: Issues with IFMXDialogServiceAsync.InputQueryAsync within synchronize call


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 1 - Last Post: Nov 3, 2017 3:32 PM Last Post By: Dave Nottage
Markus Humm

Posts: 24
Registered: 12/17/09
Issues with IFMXDialogServiceAsync.InputQueryAsync within synchronize call  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 3, 2017 7:44 AM
Hello,

I'm developing a FMX based Android app in Berlin update 2.
This app at some place creates a TThread descendant and when that sucesfully completes something
it calls some eventhandler I gave that object instance to call. The call to the event handler is put into
as synchronize call

Synchronize(nil, 
                   procedure
                   begin
                       CallMyEvent(self, true);
                   end);


Now I had to add furhter functionality which requires calling IFMXDialogServiceAsync.InputQueryAsync and
for one ModalResult case IFMXDialogServiceAsync.ShowMessageAsync.

Now the application crashes, sometimes with heap corruption sometimes with sigfault etc. and sometimes
it works.

Question: am I not allowed to use these InputQuery etc. methods inside a synchronize call?
When it crashes I sometimes see use of TMonitor in the stack trace, which makes me think that
calling those in that context might be a bad idea.

How to move them outside this context if that's the solution? Fir a short timed TTimer?

Greetings

Markus
Dave Nottage

Posts: 1,850
Registered: 1/7/00
Re: Issues with IFMXDialogServiceAsync.InputQueryAsync within synchronize call  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 3, 2017 3:32 PM   in response to: Markus Humm in response to: Markus Humm
Markus Humm wrote:

Question: am I not allowed to use these InputQuery etc. methods inside a synchronize call?

There's no reason why you shouldn't be able to. Without seeing your code (and/or a call stack) it is hard to tell what
the problem is.

--
Dave Nottage [MVP, TeamB]
Find hints, tips and tricks at Delphi Worlds blog: http://www.delphiworlds.com
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02