Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Allowing only one instance of application

Status
Not open for further replies.

darkman0101

Technical User
Oct 10, 2000
51
NZ
How can you allow only one instance of your application by be run at a time? (as opposed to word say.)
would you have to enumerate the running processes looking for a copy of your app and if one is found bomb out of the most recent? Or is there a way to do it OOP style by having a java like constructor that allows only one instance to be created. Or is there a switch in the VB environment that can be set?

Cheers in advance.

Jason
 
Include this early in your startup module, before loading any forms, etc.
[tt]
If App.PrevInstance Then End
[/tt]
You shouldn't have much memory leakage, though there may be cleaner ways to terminate at such an early stage.
VCA.gif

Alt255@Vorpalcom.Intranets.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top