473,511 Members | 16,888 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

singleton

Hi

I would like to implement a singleton in vb.net. The application only can be
run by one user at the time. Does anyone have any articles/samples that can
help me with this problem? thanks

N
Apr 22 '07 #1
5 1437
http://channel9.msdn.com/ShowPost.as...&PostID=221990 is an
intersting thread on this topic. There are links there as well to
other approaches.

Hope that helps.
Ralph Shillington
iFoundTIme Inc
http://www.ifoundtime.com/community
home of the coffee break tutorials.

On Apr 22, 5:57 pm, "Nick C" <bef...@gmail.comwrote:
Hi

I would like to implement a singleton in vb.net. The application only can be
run by one user at the time. Does anyone have any articles/samples that can
help me with this problem? thanks

N

Apr 23 '07 #2
"Nick C" <be****@gmail.comwrote in
news:uE**************@TK2MSFTNGP03.phx.gbl:
Hi

I would like to implement a singleton in vb.net. The application only
can be run by one user at the time. Does anyone have any
articles/samples that can help me with this problem? thanks
Are you using VS.NET 2005? VS.NET 2005 Windows Form projects have the
ability to specify single instance or not.
Either way, take a look at using a Mutex. A mutex is a system wide
synchronization object - thus you can use it to check if there is a prior
instance of the object running.
Apr 23 '07 #3

This of course depends on whether the application accesses resources outside
the scope of your PC, or makes resources available to other
machines on the network or via. remoting. Its simple to make the
application itself "single instance" (i.e. one instance running on one PC),
simply in your project properties -application -single instance.
However if you want to block other machines from running at the same time,
you will need some kind of license management. This is my easily achieved
in my view by using hardware dongles.

Apr 23 '07 #4
Nick,

You got your answer from Duracel, however try to ask in your subjects what
you mean, what you ask is not a singleton.

Cor

"Nick C" <be****@gmail.comschreef in bericht
news:uE**************@TK2MSFTNGP03.phx.gbl...
Hi

I would like to implement a singleton in vb.net. The application only can
be run by one user at the time. Does anyone have any articles/samples that
can help me with this problem? thanks

N

Apr 23 '07 #5
you want a mutex not a singleton, a singleton is a different thing ;)

"Nick C" <be****@gmail.comwrote in message
news:uE**************@TK2MSFTNGP03.phx.gbl...
Hi

I would like to implement a singleton in vb.net. The application only can
be run by one user at the time. Does anyone have any articles/samples that
can help me with this problem? thanks

N

Apr 23 '07 #6

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

Similar topics

7
12458
by: Tim Clacy | last post by:
Is there such a thing as a Singleton template that actually saves programming effort? Is it possible to actually use a template to make an arbitrary class a singleton without having to: a)...
10
2623
by: E. Robert Tisdale | last post by:
Could somebody please help me with the definition of a singleton? > cat singleton.cc class { private: // representation int A; int B; public: //functions
1
2442
by: Jim Strathmeyer | last post by:
So I'm trying to implement a singleton template class, but I'm getting a confusing 'undefined reference' when it tries to link. Here's the code and g++'s output. Any help? // singleton.h ...
3
2466
by: Alicia Roberts | last post by:
Hello everyone, I have been researching the Singleton Pattern. Since the singleton pattern uses a private constructor which in turn reduces extendability, if you make the Singleton Polymorphic...
7
3251
by: Ethan | last post by:
Hi, I have a class defined as a "Singleton" (Design Pattern). The codes are attached below. My questions are: 1. Does it has mem leak? If no, when did the destructor called? If yes, how can I...
3
3912
by: Harry | last post by:
Hi ppl I have a doubt on singleton class. I am writing a program below class singleton { private: singleton(){}; public: //way 1
5
5293
by: Pelle Beckman | last post by:
Hi, I've done some progress in writing a rather simple singleton template. However, I need a smart way to pass constructor arguments via the template. I've been suggested reading "Modern C++...
6
2258
by: Manuel | last post by:
Consider the classic singleton (from Thinking in C++): ----------------------------------------------------- //: C10:SingletonPattern.cpp #include <iostream> using namespace std; class...
3
18224
weaknessforcats
by: weaknessforcats | last post by:
Design Pattern: The Singleton Overview Use the Singleton Design Pattern when you want to have only one instance of a class. This single instance must have a single global point of access. That...
3
1777
by: stevewilliams2004 | last post by:
I am attempting to create a singleton, and was wondering if someone could give me a sanity check on the design - does it accomplish my constraints, and/or am I over complicating things. My design...
0
7138
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
7355
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
7423
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7081
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5668
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
4737
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
3225
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
3213
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
447
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.