Infralution Support Forum Index Infralution Support
Support groups for Infralution products
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

evaluationDialog.ShowDialog() returns immediately

 
Post new topic   Reply to topic    Infralution Support Forum Index -> Licensing Support
View previous topic :: View next topic  
Author Message
bowler



Joined: 14 Aug 2010
Posts: 1

PostPosted: Sat Aug 14, 2010 6:33 pm    Post subject: evaluationDialog.ShowDialog() returns immediately Reply with quote

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
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Sat Aug 14, 2010 11:47 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Infralution Support Forum Index -> Licensing Support All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group