View previous topic :: View next topic |
Author |
Message |
bowler
Joined: 14 Aug 2010 Posts: 1
|
Posted: Sat Aug 14, 2010 6:33 pm Post subject: evaluationDialog.ShowDialog() returns immediately |
|
|
I have a WPF application and have the following code in the Application_Startup() method. When I run this, the first call to evaluationDialog.ShowDialog() returns immediately with an Exit value. To get it to work, I have to call it again. What could be the problem? I am running this on Windows 7 Ultimate.
while (_license == null)
{
EvaluationMonitor evaluationMonitor = new RegistryEvaluationMonitor("SomePassword");
EvaluationDialog evaluationDialog = new EvaluationDialog(evaluationMonitor, "MyLicensedApp");
evaluationDialog.TrialDays = 7;
evaluationDialog.ExtendedTrialDays = 7;
EvaluationDialogResult dialogResult = evaluationDialog.ShowDialog();
//for some reason the first ShowDialog() returns Exit immediately so we have to call it again
dialogResult = evaluationDialog.ShowDialog();
if (dialogResult == EvaluationDialogResult.Exit)
{
// exit the app
Application.Current.Shutdown();
return;
}
...... |
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Sat Aug 14, 2010 11:47 pm Post subject: |
|
|
If you run the (unmodified) sample WPF application (in the ILS samples) does the same issue occur?
When you show a modal dialog in windows/.NET the thread blocks until a WM_CLOSE message is received on the message loop. I have seen this sort of behaviour occur in other instances where there is multi-threading and somehow another window is closed resulting in the thread returning. _________________ Infralution Support |
|
Back to top |
|
|
|