473,507 Members | 2,375 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Does anyone knows how to "disable multiple instances of application"?!



Jul 22 '05 #1
3 1919
fish wrote:


Somebody in the newsgroup for your platform should know. C++ has no
concept of "application". A C++ program (from the C++ point of view)
is a single thread running on a single processor. Multiple processes,
multiple "instances" of application, are all foreign concepts to C++,
usually provided by the OS.

V
Jul 22 '05 #2
On Sat, 13 Nov 2004 16:58:43 +0100, "fish" <fi**@eunet.yu> wrote:


At best, you could try to use the File I/O to create a file, and use the
presence of that file as a presence of another instance (and even then,
it's not a reliable method.) Otherwise, you need to ask the newsgroup
associated with the platform you are running.

Jul 22 '05 #3

There is no way of "disabling" multiple instances of an application.

What most programs that require this behaviour do is use a system
specific mechanism to detect wether the "application" is currently
running and initiate a communication with the other instance to "take over".

One method commonly used is to create a locking file that is kept open
by the application and "locked" (again off topic here) so that if the
application is shut down improperly, it will be automatically be
unlocked by the operating system. Communication can be done using a
named pipe, socket or any other favorite IPC mechanism you want, all
off-topic here.

Nontheless, the code is quite trivial.
Jul 22 '05 #4

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

Similar topics

3
8594
by: Phil Powell | last post by:
Has anyone here ever done a case where you have a select multiple form element and you have to do both server-side and client-side validation? I am honestly not sure how to do it in Javascript (I...
6
7704
by: Rolf Wester | last post by:
Hi, I have a form with a select element with multiple="true". When using the GET method (I suppose the same happens with the POST method) I can seen that the form sends channels=CH1&channels=CH2...
5
1283
by: Dave Opstad | last post by:
File this one under "enhancement request" I guess, but it would sure be nice. I wrote this line the other day, thinking it would just work: x = struct.pack(">HhhhhhhHHHL", i, *bounds, *b, *b,...
2
2344
by: ZubZero | last post by:
Hello, i have to write a utility in c++ for windows 2k/XP. But i have 2 difficult problems. I asked many programmers i know, but none of them was able to tell me how i can do this. 1. I...
7
31537
by: Steve | last post by:
I have a SQL query I'm invoking via VB6 & ADO 2.8, that requires three "Left Outer Joins" in order to return every transaction for a specific set of criteria. Using three "Left Outer Joins"...
6
2514
by: Don Leverton | last post by:
Hi All, I've got a situation where I am developing an Access 97 app for a client, and am in the "beta testing" stage. I have split the app up, using the DB splitter, into front-end /back-end...
5
19990
by: Alex Maghen | last post by:
In ASPX 2.0 with MasterPages and all that, my entire page only has one actual <FORM>. But there are several different sections of the page that provide what are functionally separate forms with...
7
16526
by: andrewfsears | last post by:
I have a question: I was wondering if it is possible to simulate the multiple constructors, like in Java (yes, I know that the languages are completely different)? Let's say that I have a class...
1
2013
by: Troy Bull | last post by:
I have a simple application, that I use the built in navigation bar. I set the add and delete buttons enabled property to false, and it looks good, until.. Once I click on the arrow to navigate...
0
7223
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7111
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7319
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
5623
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4702
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3191
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3179
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1542
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
412
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.