Hello,
I read this thread about ObservableFinished()
, and it works fine so far: I have all the data I need in my result struct, and it's available in the Lambda I pass to AddObserver()
.
However, when my job
is finished, I want to display a GeModalDialog
. Opening a simple OS message box with GeOutString()
works fine. But when I instead try to open a custom dialog, nothing happens.
Here's the code:
// Create job
auto checkForUpdate = CheckForUpdateJob::Create() iferr_return;
checkForUpdate.ObservableFinished().AddObserver([checkForUpdate]() -> maxon::Result<void>
{
iferr_scope;
// Get job's result. this works fine.
MyResultStruct result = checkForUpdate.GetResult() iferr_return;
if (result.updateAvailable)
{
// This works:
if (GeOutString(GeLoadString(IDS_UPDATECHECK_RESULT_AVAILABLE), GEMB::YESNO) == GEMB_R::V_YES)
{
DoSomething();
}
// This does not work:
MyModalDialog theDialog;
theDialog.Open();
}
return maxon::OK;
}) iferr_return;
// Enqueue job
checkForUpdate.Enqueue();
Why is a GeModalDialog
not working? And how can I make it work?
Thanks in advance,
greetings,
Frank