473,320 Members | 1,952 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Mutex and messages

Hi,

I have a WinForms desktop MDI application written in C#. Following advice
from others in this forum, I prevent multiple instances of the app running
at the same time by creating / trying to create a mutex, as follows:

bool blnCreatedMutex;
objMutex = new System.Threading.Mutex(true, "zzzzzzMyCoolAppzzzzz", out
blnCreatedMutex);
if (!blnCreatedMutex)
{
MessageBox.Show("My Cool App is already running", "Error",
MessageBoxButtons.OK, MessageBoxIcon.Stop);
this.Close();
return;
}

The app saves data files onto the file system, and I have associated these
files' extension with the app's executable. All is well - I interrogate the
args property when the app loads and try to open any files found there e.g.

foreach (string strArg in astrArgs)
{
openFile(strArg);
}

No doubt you can all guess the next question... :-) if the app is already
running, and the user double-clicks one of its files, I want to somehow get
a message to it to open the file(s) found in the args of the second
instance, which I will then terminate.

Any assistance gratefully received.

Best,

Mark
Nov 16 '05 #1
25 2406
Unless I miss an easy solution, this would require some kind of IPC message.
1) User clicks on file ex.
2) New app opens.
3) New app gets file name, and figures out another instance is open.
4) It sends a message to a Named Pipe or Memory mapped file, or file.
5) It also signals a named event that first blocks on in another thread.
6) First app unblocks wait thread and figures out the file name and does
what ever.

I guess you could simplify by using a known hidden file or something. Then
when you get the event, you open and look in the file for file name and path
and do your thing. Other possibilities here. HTH

--
William Stacey, MVP

"Mark Rae" <ma**@markrae.co.uk> wrote in message
news:Of*************@tk2msftngp13.phx.gbl...
Hi,

I have a WinForms desktop MDI application written in C#. Following advice
from others in this forum, I prevent multiple instances of the app running
at the same time by creating / trying to create a mutex, as follows:

bool blnCreatedMutex;
objMutex = new System.Threading.Mutex(true, "zzzzzzMyCoolAppzzzzz", out blnCreatedMutex);
if (!blnCreatedMutex)
{
MessageBox.Show("My Cool App is already running", "Error",
MessageBoxButtons.OK, MessageBoxIcon.Stop);
this.Close();
return;
}

The app saves data files onto the file system, and I have associated these
files' extension with the app's executable. All is well - I interrogate the args property when the app loads and try to open any files found there e.g.
foreach (string strArg in astrArgs)
{
openFile(strArg);
}

No doubt you can all guess the next question... :-) if the app is already
running, and the user double-clicks one of its files, I want to somehow get a message to it to open the file(s) found in the args of the second
instance, which I will then terminate.

Any assistance gratefully received.

Best,

Mark


Nov 16 '05 #2
William,

Remoting, Other IPC:s such as mailslots, send message .. <insert
more ideas here>

HTH,

//Andreas
"William Stacey [MVP]" <st***********@mvps.org> skrev i meddelandet
news:uW**************@TK2MSFTNGP12.phx.gbl...
Unless I miss an easy solution, this would require some kind of IPC message. 1) User clicks on file ex.
2) New app opens.
3) New app gets file name, and figures out another instance is open.
4) It sends a message to a Named Pipe or Memory mapped file, or file.
5) It also signals a named event that first blocks on in another thread.
6) First app unblocks wait thread and figures out the file name and does
what ever.

I guess you could simplify by using a known hidden file or something. Then when you get the event, you open and look in the file for file name and path and do your thing. Other possibilities here. HTH

--
William Stacey, MVP

"Mark Rae" <ma**@markrae.co.uk> wrote in message
news:Of*************@tk2msftngp13.phx.gbl...
Hi,

I have a WinForms desktop MDI application written in C#. Following advice from others in this forum, I prevent multiple instances of the app running at the same time by creating / trying to create a mutex, as follows:

bool blnCreatedMutex;
objMutex = new System.Threading.Mutex(true, "zzzzzzMyCoolAppzzzzz",

out
blnCreatedMutex);
if (!blnCreatedMutex)
{
MessageBox.Show("My Cool App is already running", "Error",
MessageBoxButtons.OK, MessageBoxIcon.Stop);
this.Close();
return;
}

The app saves data files onto the file system, and I have associated these files' extension with the app's executable. All is well - I interrogate

the
args property when the app loads and try to open any files found there

e.g.

foreach (string strArg in astrArgs)
{
openFile(strArg);
}

No doubt you can all guess the next question... :-) if the app is already running, and the user double-clicks one of its files, I want to somehow

get
a message to it to open the file(s) found in the args of the second
instance, which I will then terminate.

Any assistance gratefully received.

Best,

Mark

Nov 16 '05 #3
"William Stacey [MVP]" <st***********@mvps.org> wrote in message
news:uW**************@TK2MSFTNGP12.phx.gbl...
Unless I miss an easy solution, this would require some kind of IPC message.

OK.
4) It sends a message to a Named Pipe or Memory mapped file, or file.


That's the bit I'm stuck on...
Nov 16 '05 #4
"Andreas Håkansson" <andy.h (at) telia.com> wrote in message
news:Oe**************@TK2MSFTNGP12.phx.gbl...

Andreas,
Remoting, Other IPC:s such as mailslots, send message .. <insert more

ideas here>

With the greatest of respect, what does this actually mean...?
Nov 16 '05 #5
Mark,

Sorry about that, don't know what got in to me =) Well lets see..
Remoting is the IPC (Inter Process Communication) mechanism which
is shipped with the .NET Framrwork. You can look this up in the docs
and see how you can grab and object from an application and call methods
on it (second instance gets object and informs first instance about file).

There are also a number of IPC: methods built in Windows. Names Pipes,
which William mentioned, is one method MailSlots is another. You can find
more information about these at [1]. However these do require you to use
p/Invoke to use

[1]
http://msdn.microsoft.com/library/de...unications.asp

HTH,

//Andreas

"Mark Rae" <ma**@markrae.co.uk> skrev i meddelandet
news:Ot**************@TK2MSFTNGP10.phx.gbl...
"Andreas Håkansson" <andy.h (at) telia.com> wrote in message
news:Oe**************@TK2MSFTNGP12.phx.gbl...

Andreas,
Remoting, Other IPC:s such as mailslots, send message .. <insert more

ideas here>

With the greatest of respect, what does this actually mean...?

Nov 16 '05 #6
"Andreas Håkansson" <andy.h (at) telia.com> wrote in message
news:uD**************@TK2MSFTNGP09.phx.gbl...
Sorry about that, don't know what got in to me =) Well lets see..
That's OK... :-)
Remoting is the IPC (Inter Process Communication) mechanism which
is shipped with the .NET Framrwork. You can look this up in the docs
and see how you can grab and object from an application and call methods
on it (second instance gets object and informs first instance about file).
Right! That looks promising - I'll investigate Remoting first.
There are also a number of IPC: methods built in Windows. Names Pipes,
which William mentioned, is one method MailSlots is another. You can find
more information about these at [1]. However these do require you to use
p/Invoke to use


I'm quite comfortable using p/Invoke, as my app already includes several API
calls.

Thanks again.

Mark
Nov 16 '05 #7
Mark Rae <ma**@markrae.co.uk> wrote:

<snip>
No doubt you can all guess the next question... :-) if the app is already
running, and the user double-clicks one of its files, I want to somehow get
a message to it to open the file(s) found in the args of the second
instance, which I will then terminate.


One alternative here is to open a listening socket (on the loopback
adapter) and let that act as the mutex and the communication mechanism.
Only one instance of the app will be able to bind to the port as a
listener, so further instances will fail to bind but could then connect
*to* the port and tell the listener what file to open.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #8
"Jon Skeet [C# MVP]" <sk***@pobox.com> wrote in message
news:MP************************@msnews.microsoft.c om...

Jon,
One alternative here is to open a listening socket (on the loopback
adapter) and let that act as the mutex and the communication mechanism.
Only one instance of the app will be able to bind to the port as a
listener, so further instances will fail to bind but could then connect
*to* the port and tell the listener what file to open.


Sounds like a fabulous idea, and precisely what I'm looking for! If only I
knew how...

BTW, is this such an *unusual* thing to want to do? I'd have thought that,
for anyone writing MDI WinForms apps, it'd be pretty standard stuff. Is this
how e.g. Excel and Word do it...?
Nov 16 '05 #9
Mark,

I belive the office applications register them self in the ROT which
would enable you to get a hold of the COM object and invoke calls
on it. Object in the ROT are identified by a moniker.

HTH,

//Andreas

"Mark Rae" <ma**@markrae.co.uk> skrev i meddelandet
news:%2****************@tk2msftngp13.phx.gbl...
"Jon Skeet [C# MVP]" <sk***@pobox.com> wrote in message
news:MP************************@msnews.microsoft.c om...

Jon,
One alternative here is to open a listening socket (on the loopback
adapter) and let that act as the mutex and the communication mechanism.
Only one instance of the app will be able to bind to the port as a
listener, so further instances will fail to bind but could then connect
*to* the port and tell the listener what file to open.
Sounds like a fabulous idea, and precisely what I'm looking for! If only I
knew how...

BTW, is this such an *unusual* thing to want to do? I'd have thought that,
for anyone writing MDI WinForms apps, it'd be pretty standard stuff. Is

this how e.g. Excel and Word do it...?

Nov 16 '05 #10
Mark Rae <ma**@markrae.co.uk> wrote:
One alternative here is to open a listening socket (on the loopback
adapter) and let that act as the mutex and the communication mechanism.
Only one instance of the app will be able to bind to the port as a
listener, so further instances will fail to bind but could then connect
*to* the port and tell the listener what file to open.


Sounds like a fabulous idea, and precisely what I'm looking for! If only I
knew how...


Well, start looking at the docs for TcpListener and TcpClient. The rest
is a simple matter of programming :)

<snip>

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #11
"Jon Skeet [C# MVP]" <sk***@pobox.com> wrote in message
news:MP************************@msnews.microsoft.c om...

Jon,
One alternative here is to open a listening socket (on the loopback
adapter) and let that act as the mutex and the communication mechanism.
Only one instance of the app will be able to bind to the port as a
listener, so further instances will fail to bind but could then connect
*to* the port and tell the listener what file to open.


Sounds like a fabulous idea, and precisely what I'm looking for! If only I
knew how...

BTW, is this such an *unusual* thing to want to do? I'd have thought that,
for anyone writing MDI WinForms apps, it'd be pretty standard stuff. Is this
how e.g. Excel and Word do it...?
Nov 16 '05 #12
Mark,

I belive the office applications register them self in the ROT which
would enable you to get a hold of the COM object and invoke calls
on it. Object in the ROT are identified by a moniker.

HTH,

//Andreas

"Mark Rae" <ma**@markrae.co.uk> skrev i meddelandet
news:%2****************@tk2msftngp13.phx.gbl...
"Jon Skeet [C# MVP]" <sk***@pobox.com> wrote in message
news:MP************************@msnews.microsoft.c om...

Jon,
One alternative here is to open a listening socket (on the loopback
adapter) and let that act as the mutex and the communication mechanism.
Only one instance of the app will be able to bind to the port as a
listener, so further instances will fail to bind but could then connect
*to* the port and tell the listener what file to open.
Sounds like a fabulous idea, and precisely what I'm looking for! If only I
knew how...

BTW, is this such an *unusual* thing to want to do? I'd have thought that,
for anyone writing MDI WinForms apps, it'd be pretty standard stuff. Is

this how e.g. Excel and Word do it...?

Nov 16 '05 #13
Mark Rae <ma**@markrae.co.uk> wrote:
One alternative here is to open a listening socket (on the loopback
adapter) and let that act as the mutex and the communication mechanism.
Only one instance of the app will be able to bind to the port as a
listener, so further instances will fail to bind but could then connect
*to* the port and tell the listener what file to open.


Sounds like a fabulous idea, and precisely what I'm looking for! If only I
knew how...


Well, start looking at the docs for TcpListener and TcpClient. The rest
is a simple matter of programming :)

<snip>

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #14

"Jon Skeet [C# MVP]" <sk***@pobox.com> wrote in message
news:MP************************@msnews.microsoft.c om...
Mark Rae <ma**@markrae.co.uk> wrote:
One alternative here is to open a listening socket (on the loopback
adapter) and let that act as the mutex and the communication mechanism. Only one instance of the app will be able to bind to the port as a
listener, so further instances will fail to bind but could then connect *to* the port and tell the listener what file to open.


Sounds like a fabulous idea, and precisely what I'm looking for! If only I knew how...


Well, start looking at the docs for TcpListener and TcpClient. The rest
is a simple matter of programming :)


Thanks for that - found the following article:
http://www.codeguru.com/Csharp/.NET/...cle.php/c4611/
which seems to explain the mechanism well enough.

Question: if I were to use something like, say,

TcpListener listener = new TcpListener(IPAddress.Loopback,8080);

would there be any hardware / OS restrictions on this? I.e. does the user
*have* to have a network card? Will this work on completely stand-alone PCs?
Will this work on every operating system supported by the .NET Framework?

Also, presumably there's nothing to guarantee that another application or
process hasn't already opened port 8080, or whichever one I choose...?
Nov 16 '05 #15
Mark Rae <ma**@markrae.co.uk> wrote:
Well, start looking at the docs for TcpListener and TcpClient. The rest
is a simple matter of programming :)


Thanks for that - found the following article:
http://www.codeguru.com/Csharp/.NET/...cle.php/c4611/
which seems to explain the mechanism well enough.

Question: if I were to use something like, say,

TcpListener listener = new TcpListener(IPAddress.Loopback,8080);

would there be any hardware / OS restrictions on this? I.e. does the user
*have* to have a network card? Will this work on completely stand-alone PCs?
Will this work on every operating system supported by the .NET Framework?

Also, presumably there's nothing to guarantee that another application or
process hasn't already opened port 8080, or whichever one I choose...?


I think there *may* be a problem on Windows 98, but I'm not sure. I
don't believe you have to have a network card.

Indeed there's nothing to guarantee that another app won't have opened
whichever port you choose. If you choose something pretty obscure and
"high numbered" (over 40000 say) you should be safe enough. 8080 would
be a pretty bad choice, as various things have that as a default port.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #16
"Jon Skeet [C# MVP]" <sk***@pobox.com> wrote in message
news:MP************************@msnews.microsoft.c om...
I think there *may* be a problem on Windows 98, but I'm not sure.
I think we could probably live with that...
I don't believe you have to have a network card.
So, is support for TCP/IP and the loopback adaptor built-in to the .NET
Framework?
Indeed there's nothing to guarantee that another app won't have opened
whichever port you choose. If you choose something pretty obscure and
"high numbered" (over 40000 say) you should be safe enough. 8080 would
be a pretty bad choice, as various things have that as a default port.


Yes, I realised that 8080 would be bad, and would indeed have chosen a
high-numbered port.

I suppose the only other option which would be guaranteed to work on all
operating systems supported by the .NET Framework would be to create a temp
file in a known directory for every argument passed to the app and set up a
timer to "sniff" this folder at regular intervals. According to the docs,
the FileSystemWatcher won't work on 98 or Me...
Nov 16 '05 #17
Mark Rae <ma**@markrae.co.uk> wrote:
I don't believe you have to have a network card.


So, is support for TCP/IP and the loopback adaptor built-in to the .NET
Framework?


Well, support for them is in the .NET framework, but I believe anything
after Win98 has loopback adapter support in it anyway.
Indeed there's nothing to guarantee that another app won't have opened
whichever port you choose. If you choose something pretty obscure and
"high numbered" (over 40000 say) you should be safe enough. 8080 would
be a pretty bad choice, as various things have that as a default port.


Yes, I realised that 8080 would be bad, and would indeed have chosen a
high-numbered port.

I suppose the only other option which would be guaranteed to work on all
operating systems supported by the .NET Framework would be to create a temp
file in a known directory for every argument passed to the app and set up a
timer to "sniff" this folder at regular intervals. According to the docs,
the FileSystemWatcher won't work on 98 or Me...


That sounds like a bad idea to me - FileSystemWatcher is pretty
unreliable from all I've heard, and if you're not careful you'll end up
with temporary files around etc.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #18

"Jon Skeet [C# MVP]" <sk***@pobox.com> wrote in message
news:MP************************@msnews.microsoft.c om...
Mark Rae <ma**@markrae.co.uk> wrote:
One alternative here is to open a listening socket (on the loopback
adapter) and let that act as the mutex and the communication mechanism. Only one instance of the app will be able to bind to the port as a
listener, so further instances will fail to bind but could then connect *to* the port and tell the listener what file to open.


Sounds like a fabulous idea, and precisely what I'm looking for! If only I knew how...


Well, start looking at the docs for TcpListener and TcpClient. The rest
is a simple matter of programming :)


Thanks for that - found the following article:
http://www.codeguru.com/Csharp/.NET/...cle.php/c4611/
which seems to explain the mechanism well enough.

Question: if I were to use something like, say,

TcpListener listener = new TcpListener(IPAddress.Loopback,8080);

would there be any hardware / OS restrictions on this? I.e. does the user
*have* to have a network card? Will this work on completely stand-alone PCs?
Will this work on every operating system supported by the .NET Framework?

Also, presumably there's nothing to guarantee that another application or
process hasn't already opened port 8080, or whichever one I choose...?
Nov 16 '05 #19
Mark Rae <ma**@markrae.co.uk> wrote:
Well, start looking at the docs for TcpListener and TcpClient. The rest
is a simple matter of programming :)


Thanks for that - found the following article:
http://www.codeguru.com/Csharp/.NET/...cle.php/c4611/
which seems to explain the mechanism well enough.

Question: if I were to use something like, say,

TcpListener listener = new TcpListener(IPAddress.Loopback,8080);

would there be any hardware / OS restrictions on this? I.e. does the user
*have* to have a network card? Will this work on completely stand-alone PCs?
Will this work on every operating system supported by the .NET Framework?

Also, presumably there's nothing to guarantee that another application or
process hasn't already opened port 8080, or whichever one I choose...?


I think there *may* be a problem on Windows 98, but I'm not sure. I
don't believe you have to have a network card.

Indeed there's nothing to guarantee that another app won't have opened
whichever port you choose. If you choose something pretty obscure and
"high numbered" (over 40000 say) you should be safe enough. 8080 would
be a pretty bad choice, as various things have that as a default port.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #20
"Jon Skeet [C# MVP]" <sk***@pobox.com> wrote in message
news:MP************************@msnews.microsoft.c om...
I think there *may* be a problem on Windows 98, but I'm not sure.
I think we could probably live with that...
I don't believe you have to have a network card.
So, is support for TCP/IP and the loopback adaptor built-in to the .NET
Framework?
Indeed there's nothing to guarantee that another app won't have opened
whichever port you choose. If you choose something pretty obscure and
"high numbered" (over 40000 say) you should be safe enough. 8080 would
be a pretty bad choice, as various things have that as a default port.


Yes, I realised that 8080 would be bad, and would indeed have chosen a
high-numbered port.

I suppose the only other option which would be guaranteed to work on all
operating systems supported by the .NET Framework would be to create a temp
file in a known directory for every argument passed to the app and set up a
timer to "sniff" this folder at regular intervals. According to the docs,
the FileSystemWatcher won't work on 98 or Me...
Nov 16 '05 #21
Mark Rae <ma**@markrae.co.uk> wrote:
I don't believe you have to have a network card.


So, is support for TCP/IP and the loopback adaptor built-in to the .NET
Framework?


Well, support for them is in the .NET framework, but I believe anything
after Win98 has loopback adapter support in it anyway.
Indeed there's nothing to guarantee that another app won't have opened
whichever port you choose. If you choose something pretty obscure and
"high numbered" (over 40000 say) you should be safe enough. 8080 would
be a pretty bad choice, as various things have that as a default port.


Yes, I realised that 8080 would be bad, and would indeed have chosen a
high-numbered port.

I suppose the only other option which would be guaranteed to work on all
operating systems supported by the .NET Framework would be to create a temp
file in a known directory for every argument passed to the app and set up a
timer to "sniff" this folder at regular intervals. According to the docs,
the FileSystemWatcher won't work on 98 or Me...


That sounds like a bad idea to me - FileSystemWatcher is pretty
unreliable from all I've heard, and if you're not careful you'll end up
with temporary files around etc.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #22
I would think about memory mapped files (MMF). I think they are supported on
98 and over. Maybe even 95, not sure. Very fast and ~easy to wrap in
classes. Plus you can use the swap file for backing store so you don't need
to pass a file name between apps or even know a file name.

--
William Stacey, MVP

"Mark Rae" <ma**@markrae.co.uk> wrote in message
news:u8**************@TK2MSFTNGP12.phx.gbl...
"Jon Skeet [C# MVP]" <sk***@pobox.com> wrote in message
news:MP************************@msnews.microsoft.c om...
I think there *may* be a problem on Windows 98, but I'm not sure.
I think we could probably live with that...
I don't believe you have to have a network card.


So, is support for TCP/IP and the loopback adaptor built-in to the .NET
Framework?
Indeed there's nothing to guarantee that another app won't have opened
whichever port you choose. If you choose something pretty obscure and
"high numbered" (over 40000 say) you should be safe enough. 8080 would
be a pretty bad choice, as various things have that as a default port.


Yes, I realised that 8080 would be bad, and would indeed have chosen a
high-numbered port.

I suppose the only other option which would be guaranteed to work on all
operating systems supported by the .NET Framework would be to create a

temp file in a known directory for every argument passed to the app and set up a timer to "sniff" this folder at regular intervals. According to the docs,
the FileSystemWatcher won't work on 98 or Me...


Nov 16 '05 #23
"William Stacey [MVP]" <st***********@mvps.org> wrote in message
news:e5***************@TK2MSFTNGP10.phx.gbl...
I would think about memory mapped files (MMF).
I'll check it out - thanks.
I think they are supported on 98 and over. Maybe even 95, not sure.
Wow! You've got the .NET Framework to install on Win95?
http://msdn.microsoft.com/library/de...otnetfxref.asp
Very fast and ~easy to wrap in classes. Plus you can use the swap file

for backing store so you don't need to pass a file name between apps or even
know a file name.

Thanks very much for the tip.
Nov 16 '05 #24
I would think about memory mapped files (MMF). I think they are supported on
98 and over. Maybe even 95, not sure. Very fast and ~easy to wrap in
classes. Plus you can use the swap file for backing store so you don't need
to pass a file name between apps or even know a file name.

--
William Stacey, MVP

"Mark Rae" <ma**@markrae.co.uk> wrote in message
news:u8**************@TK2MSFTNGP12.phx.gbl...
"Jon Skeet [C# MVP]" <sk***@pobox.com> wrote in message
news:MP************************@msnews.microsoft.c om...
I think there *may* be a problem on Windows 98, but I'm not sure.
I think we could probably live with that...
I don't believe you have to have a network card.


So, is support for TCP/IP and the loopback adaptor built-in to the .NET
Framework?
Indeed there's nothing to guarantee that another app won't have opened
whichever port you choose. If you choose something pretty obscure and
"high numbered" (over 40000 say) you should be safe enough. 8080 would
be a pretty bad choice, as various things have that as a default port.


Yes, I realised that 8080 would be bad, and would indeed have chosen a
high-numbered port.

I suppose the only other option which would be guaranteed to work on all
operating systems supported by the .NET Framework would be to create a

temp file in a known directory for every argument passed to the app and set up a timer to "sniff" this folder at regular intervals. According to the docs,
the FileSystemWatcher won't work on 98 or Me...


Nov 16 '05 #25
"William Stacey [MVP]" <st***********@mvps.org> wrote in message
news:e5***************@TK2MSFTNGP10.phx.gbl...
I would think about memory mapped files (MMF).
I'll check it out - thanks.
I think they are supported on 98 and over. Maybe even 95, not sure.
Wow! You've got the .NET Framework to install on Win95?
http://msdn.microsoft.com/library/de...otnetfxref.asp
Very fast and ~easy to wrap in classes. Plus you can use the swap file

for backing store so you don't need to pass a file name between apps or even
know a file name.

Thanks very much for the tip.
Nov 16 '05 #26

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Srijit Kumar Bhadra | last post by:
Hello, Here is some sample code with pywin32 build 203 and ctypes 0.9.6. Best regards, /Srijit File: SharedMemCreate_Mutex_win32all.py # This application should be used with...
5
by: Ken Varn | last post by:
I have a named mutex object that is accessed by both an asp.net application and a Windows executable .net application. The Windows executable runs under the administrator logon, while the asp.net...
1
by: Rocky | last post by:
I am using the following piece of code to ensure that my application only runs once, however I have a few questions about it. static Mutex m_Mutex; << in c# I assume that when the methods are...
2
by: Martin Maat | last post by:
Hi. I want to use the same mutex in different classes (web pages in an ASP.NET application). In global.asax.cs, the class that starts up first, I create a Mutex like this: static private...
20
by: Michael A. Covington | last post by:
See: http://www.ai.uga.edu/mc/SingleInstance.html While attempting to use a mutex to allow only one instance of my app to run at a time (Recipe 4.12 in C# Programmer's Cookbook), I found that if...
17
by: Mark Rae | last post by:
Hi, I have a WinForms desktop MDI application written in C#. Following advice from others in this forum, I prevent multiple instances of the app running at the same time by creating / trying to...
16
by: Ed Sutton | last post by:
I use a mutex to disallow starting a second application instance. This did not work in a release build until I made it static member of my MainForm class. In a debug build, first instance got...
11
by: Tyler Sample | last post by:
I've been having strange thread conflicts, and after moving the relevant mutex higher and higher I've finally determined that the mutex doesn't seem to be working at all. Here is the relevant...
2
by: tony.newsgrps | last post by:
Hi there, I'm trying to understand the impact of killing a process that owns a system mutex (used to ensure there is only 1 instance of my program running) Here is my code pretty much: try...
3
by: NaeiKinDus | last post by:
Hello, i'm trying to program a thread that would be locked (by a mutex) and that would only be unlocked once that a function (generating data) is done. The purpose is to generate data, and unlock...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.