Print Page | Close Window

Run Client Once

Printed From: Mirage Source
Category: Tutorials
Forum Name: Approved Tutorials
Forum Discription: All tutorials shown to actually work with MSE are moved here.
URL: http://ms.shannaracorp.com/backup-forums/forum_posts.asp?TID=34
Printed Date: 20 December 2006 at 6:01pm
Software Version: Web Wiz Forums 8.01 - http://www.webwizforums.com


Topic: Run Client Once
Posted By: Sync
Subject: Run Client Once
Date Posted: 07 February 2006 at 5:40pm
Orginally posted by Jourdan

Simple but very useful

at form load (maybe frmMainMenu)

add


If App.PrevInstance = True Then
MsgBox "Bla Bla is already running.", Error
End





Replies:
Posted By: Sync
Date Posted: 07 February 2006 at 5:41pm
Approved



Posted By: Dragoons Master
Date Posted: 07 February 2006 at 5:55pm
Actualy this only prevent from running the SAME exe once, but if you install the client into 2 diferent folders, you still can run 2 clients.
The fix for this is simple. I'll post a tut into other topic.


Posted By: Lord Dekon
Date Posted: 07 February 2006 at 6:02pm
Ya, dragon is right lets see if he can make the correct tut


Posted By: Sync
Date Posted: 07 February 2006 at 6:03pm
Yeah, I saw a pseudo fix in reply to this in the other forum, but at least this one helps prevent running the same exact file more then once ..

You could use a mutex to check (system wide) if the process is being ran more then once.


Posted By: Lord Dekon
Date Posted: 07 February 2006 at 6:08pm
Ya, this dude did a good job, but were all just helping him out


Posted By: Da Undead
Date Posted: 05 March 2006 at 9:08am

Fix:

 

If App.PrevInstance = True Then
MsgBox "Bla Bla is already running.", Error
End

 

Should Be:

 

If App.PrevInstance = True Then
MsgBox "Bla Bla is already running.", Error
End If



Posted By: Da Undead
Date Posted: 05 March 2006 at 9:10am

Question: Are you able to change it to where it has like an Run-Time-Error then below it, it says Bla Bla is already running...?



Posted By: Misunderstood
Date Posted: 05 March 2006 at 9:35am
the end was there because end ends the probelm, so it should still be inside the if. and if you dont know how to make another msg box that says what you want I give up.


Posted By: Da Undead
Date Posted: 05 March 2006 at 10:10am
Nah, i'll just create a new frmError


Posted By: funkynut
Date Posted: 05 March 2006 at 10:22am
Or you just manually call the error


Posted By: Da Undead
Date Posted: 05 March 2006 at 10:29am

Im having a problem on making the frm.

I have it to where when you try running 2 clients at one time, frmError pops up and frmMainMenu stays there. But they can go on ahead and login and just ignore the box that pops up... I have it to where the box says what i want it to say and then it has an OK button that you click and it does Call GameDestroy. But my prob is that you can just ignore it and let it just sit there while you continue to run multiple clients... What about if I use like..

frmNewAccount:
If frmError.visible = true then
call gamedestroy

--Tried it and it still wont work. What code do i use if the frmError is open and if they click New Account, it just uses Call GameDestroy..?



Posted By: funkynut
Date Posted: 05 March 2006 at 11:28am
one word code:


end


Posted By: Da Undead
Date Posted: 05 March 2006 at 12:21pm

Wat u mean?

Oh like..

If frmError.visible = true then
Call DestroyGame
End If

??



Posted By: funkynut
Date Posted: 05 March 2006 at 1:05pm
No, Gamestroy unloads directx and stuff, which you dont need to do

Just replace it with the word end


Posted By: Da Undead
Date Posted: 05 March 2006 at 2:19pm

oh...

If frmError.visible = True Then
End

???

 



Posted By: Renegade
Date Posted: 05 March 2006 at 2:23pm
Whats the point of shows frmerror when it will only close the programm and the form seconds later XD

-------------
Eternia online, Coming soon to a movie i mean computer near you!


Posted By: tosuxo
Date Posted: 05 March 2006 at 2:24pm
god... why have a form to say it's bust... then it ends.... but you don't get chance to read it then do you?



Print Page | Close Window

Bulletin Board Software by Web Wiz Forums version 8.01 - http://www.webwizforums.com
Copyright ©2001-2006 Web Wiz Guide - http://www.webwizguide.info