I tried that at one time but could never make it work right. Of
course, that was back when I was still kind of new at Rev, so I
probably wasn't doing something right. If Trevor's solution doesn't
work for all versions of Windows, maybe I'll take another stab at
doing it this other way.
Chris
On Jul 18, 2005, at 10:20 AM, Lynch, Jonathan wrote:
This external is prolly a bit easier to use than the old way, but...
There is a cross platform method for doing this, which has been
discussed on this group. It has the convenience of checking to make
sure
that the first version is running, then if the first instance
communicates back to the second instance that it is running, the
second
instance will shut down. It involves the use of ports, which can be a
pain to use.
Just FYI
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Chris
Sheffield
Sent: Monday, July 18, 2005 12:16 PM
To: How to use Revolution
Subject: Re: External for running one instance on windows
Hi Trevor,
This is great. I've been looking for a good solution to this problem
for quite some time. I've been using a partial solution with the
EXT.dll, but it doesn't always work.
One question: Will this work on any version of Windows, or is it
specific to, say, 2000/XP?
Chris
On Jul 16, 2005, at 4:14 PM, Trevor DeVore wrote:
Hi people of the list,
I put together an external this morning that you can use to limit
your application to one running instance on Windows. It uses a
mutex object on Windows which you can read about here:
<http://msdn.microsoft.com/library/default.asp?url=/library/en-us/
dllproc/base/using_mutex_objects.asp>
There is a readme with the archive but basically there are two
handlers you use:
get ewinRegisterApp("My_App_Unique_String")
ewinUnregisterApp
You can ewinRegisterApp("My_App_Unique_String") when your app first
launches. If it returns true then there is only one instance of
your app running. If it returns false then another app has
registered the same string (in this case "My_App_Unique_String")
and you should quit.
When you quit your app you call ewinUnregisterApp to release the
mutex object you created with ewinRegisterApp().
Now you may be asking yourself what would happen if your app
crashes. Would ewinRegisterApp() still return false? The answer
is no, it would return true. Windows knows that the app that
created the original mutex object has gone the way of all
misbehaved software and it will gladly give you control of the
orphaned mutex object.
Anyway, I've tested this on Win XP so far and it seems to be
working nicely. Note that for every time you call ewinRegisterApp
() in one app you need to call ewinUnregisterApp in order for
another app to be able to have ewinRegisterApp() return true. I
may fix that, I may not. It doesn't really bother me.
Anyway, you can download it at:
<http://www.mangomultimedia.com/download/revolution/enhancedwin/
EnhancedWin.zip>
There is also a command called ewinOpenURL in the external that
will always do the right thing when trying to open a url or launch
an email client on Windows. You may find that useful as well.
If you have any questions or problems let me know. If you want the
source code you can have that too. It was compiled with Visual C+
+ .Net.
--
Trevor DeVore
Blue Mango Multimedia
[EMAIL PROTECTED]
_______________________________________________
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your
subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
------------------------------------------
Chris Sheffield
Read Naturally
The Fluency Company
http://www.readnaturally.com
------------------------------------------
_______________________________________________
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your
subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
_______________________________________________
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your
subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
------------------------------------------
Chris Sheffield
Read Naturally
The Fluency Company
http://www.readnaturally.com
------------------------------------------
_______________________________________________
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution