|
-
Aug 15th, 2001, 10:01 AM
#1
Thread Starter
Junior Member
prevent multiple executions of same vb app
I would like to prevent a user from starting up an other 'instance' of a vb application when clicking on the desktop icon if that application is already open on the desktop. How do I go about doing this? Thanks in advance for your help!
-
Aug 15th, 2001, 10:03 AM
#2
PowerPoster
use App.PrevInstance..
VB Code:
Private Sub Form_Load()
If App.PrevInstance = True Then
MsgBox "Only 1 instance!", vbCritical
End
End If
End Sub
-
Aug 15th, 2001, 10:11 AM
#3
Frenzied Member
HA... DON'T USE THE END STATEMENT. I would have though you would have figured that out by now chris. Always do this
VB Code:
dim f as form
for each form in forms
unload f
set f = nothing
next f
Government is another way to say better…than…you.
It’s like ice but no pick, a murder charge that won’t stick,
it’s like a whole other world where you can smell the food,
but you can’t touch the silverware.
Huh, what luck. Fascism you can vote for.
Humph, isn’t that sweet?
And we’re all gonna die some day, because that’s the American way
-Stone Sour
-
Aug 15th, 2001, 10:12 AM
#4
Member
Originally posted by Skitchen8
HA... DON'T USE THE END STATEMENT.[/Highlight]
I was about to say that.
-
Aug 15th, 2001, 10:14 AM
#5
Frenzied Member
Government is another way to say better…than…you.
It’s like ice but no pick, a murder charge that won’t stick,
it’s like a whole other world where you can smell the food,
but you can’t touch the silverware.
Huh, what luck. Fascism you can vote for.
Humph, isn’t that sweet?
And we’re all gonna die some day, because that’s the American way
-Stone Sour
-
Aug 15th, 2001, 10:17 AM
#6
PowerPoster
Bollocks to it. I can't be arsed to type a load of For Each Frm In Forms crap in a ****ing demo. Don't be so damn pedantic
-
Aug 15th, 2001, 10:22 AM
#7
Frenzied Member
Government is another way to say better…than…you.
It’s like ice but no pick, a murder charge that won’t stick,
it’s like a whole other world where you can smell the food,
but you can’t touch the silverware.
Huh, what luck. Fascism you can vote for.
Humph, isn’t that sweet?
And we’re all gonna die some day, because that’s the American way
-Stone Sour
-
Aug 15th, 2001, 10:26 AM
#8
PowerPoster
Maybe you were, but don't ***** at me for using End...
You app has only got chance to open 1 form if using that cod, so it's fine just to put Unload Me anyway...
-
Aug 15th, 2001, 10:28 AM
#9
Frenzied Member
ok... ok, we weren't bitching at you we were suggesting to Laura Moloney to use that code because it will free up the memory used by your app
Government is another way to say better…than…you.
It’s like ice but no pick, a murder charge that won’t stick,
it’s like a whole other world where you can smell the food,
but you can’t touch the silverware.
Huh, what luck. Fascism you can vote for.
Humph, isn’t that sweet?
And we’re all gonna die some day, because that’s the American way
-Stone Sour
-
Aug 15th, 2001, 10:33 AM
#10
Thread Starter
Junior Member
I thank you all for jumping in and not only answering my original question so quickly, but also remind me of good programming techniques, something I find useful to be reminded of from time to time. Plus the added bonus was that in my code, I was unloading forms individually, so the 'shortcut' shown here is very helpful! I also have to say I enjoyed your playful(?) bickering. KUDOS to all of you.................
-
Aug 15th, 2001, 10:34 AM
#11
Frenzied Member
yes, our bickering is always enjoyable to watch....
Government is another way to say better…than…you.
It’s like ice but no pick, a murder charge that won’t stick,
it’s like a whole other world where you can smell the food,
but you can’t touch the silverware.
Huh, what luck. Fascism you can vote for.
Humph, isn’t that sweet?
And we’re all gonna die some day, because that’s the American way
-Stone Sour
-
Aug 15th, 2001, 10:35 AM
#12
PowerPoster
Originally posted by Laura Moloney
I also have to say I enjoyed your playful(?) bickering. KUDOS to all of you.................
We all love each other really
-
Aug 15th, 2001, 10:38 AM
#13
Frenzied Member
NO CHRIS, I THOUGHT I TOLD YOU I WASN'T GAY ANYMORE... LOL j/k i love you too
Government is another way to say better…than…you.
It’s like ice but no pick, a murder charge that won’t stick,
it’s like a whole other world where you can smell the food,
but you can’t touch the silverware.
Huh, what luck. Fascism you can vote for.
Humph, isn’t that sweet?
And we’re all gonna die some day, because that’s the American way
-Stone Sour
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
|