EQ2Interface

EQ2Interface (https://www.eq2interface.com/forums/index.php)
-   EQ2Map Troubleshooting (https://www.eq2interface.com/forums/forumdisplay.php?f=36)
-   -   Small code fix (https://www.eq2interface.com/forums/showthread.php?t=3976)

Ruddles 08-18-2005 02:37 PM

Small code fix
 
Have a small fix to stop people opening up 2 instances of the updater up at the same time, thus stopping people (in theory) getting the "access is denied" error because the file is already locked:

In Public Sub New() under the comment "'Add any initialization after the InitializeComponent() call":

Code:

Dim gotit As Boolean
Dim mut As New Mutex(True, "EQ2UpdateMut", gotit)

This creates a Mutex that is locked til the program ends. If you start another instance of it up then it tried to get access to this mutex, can't, and exits nicely with "1 instance" error message.

taco-man 08-18-2005 03:03 PM

thanks this is much simpler than the way i was doing it...and it always works :D

sorry for not having so much knowledge of vb.net to know this but that should change this year when i start college getting my computer science degree. thanks again for the info; I would love to hear any other suggestions from you if you have them.

Ruddles 08-18-2005 04:14 PM

No probs. You've done a great job with the updater for someone who doesn't know VB.NET (you've done a great job with it for someone who does too). I currently develop C# for a large company and I wouldn't want to undertake something like the updater as a first project. Usually people just go for a "hello world" program :p


All times are GMT -5. The time now is 01:45 PM.

vBulletin® - Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
© MMOUI