|
-
Aug 18th, 2009, 01:12 AM
#1
Thread Starter
Addicted Member
How to prevent opening of two instances?
Hi,
What's the best way to prevent opening of two instances (or more) of the application?
Thanks
-
Aug 18th, 2009, 01:18 AM
#2
Re: How to prevent opening of two instances?
Check the single-instance box in the project property pages.
-
Aug 18th, 2009, 01:22 AM
#3
Thread Starter
Addicted Member
Re: How to prevent opening of two instances?
Thanks. Where is it exactly? I can't find it...
-
Aug 18th, 2009, 01:29 AM
#4
Re: How to prevent opening of two instances?
Is this a Windows Forms Application project, as I am assuming? If so the box is there in the project properties and if you look you'll find it. If it's not a WinForms app then there is no such box and you'd have to handle it manually.
-
Aug 18th, 2009, 01:32 AM
#5
Thread Starter
Addicted Member
Re: How to prevent opening of two instances?
OK, I see that I have to enable application framework and then I can set the single instance.
What is the affect of "enable application framework"?
You can see that I'm a newbie in VB.NET. I'm coming from VB6 and C++
-
Aug 18th, 2009, 01:45 AM
#6
Re: How to prevent opening of two instances?
The application framework should be enabled by default for new projects. Was your project upgraded from VB6 or VB.NET 2002/2003? If not then you must have disabled the application framework explicitly.
The application framework exists to do things like this. It will manage single-instance apps, splash screens, etc. for you so you don't have to write fiddly code to perform common application-based tasks. With the framework enabled the Main method is hidden from you and you handle application-level events, e.g. Startup and Shutdown, to do things that you would otherwise have done in the Main method.
-
Aug 18th, 2009, 01:47 AM
#7
Thread Starter
Addicted Member
Re: How to prevent opening of two instances?
OK, I see that I have to enable application framework and then I can set the single instance.
What is the affect of "enable application framework"?
You can see that I'm a newbie in VB.NET. I'm coming from VB6 and C++
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|