473,406 Members | 2,352 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,406 software developers and data experts.

Single instance DLL

Nak
Hi there,

I am attempting to make a single instance DLL in C++. This means that I
only want 1 copy to be loaded at any time and the DLL's data is shared
throughout processes.

For example, I have a VB.NET app connecting to my DLL and calling a
function called addOne in the DLL, this then adds 1 to a static integer in
the DLL and returns the value. The problem is that if I load 2 instances of
the VB.NET app then I get 2 instance of the DLL loaded with completely
different values for the "static integer" in the DLL. I know that this was
quite an easy thing to achieve in VB6 via the project properties, but how
would I go about achieving this in Visual Studio .NET 2003 with a C++
project?

Thanks loads in advance!

Nak.
Nov 17 '05 #1
2 4128
On Tue, 8 Jun 2004 10:53:01 +0100, "Nak" <a@a.com> wrote:
Hi there,

I am attempting to make a single instance DLL in C++. This means that I
only want 1 copy to be loaded at any time and the DLL's data is shared
throughout processes.

For example, I have a VB.NET app connecting to my DLL and calling a
function called addOne in the DLL, this then adds 1 to a static integer in
the DLL and returns the value. The problem is that if I load 2 instances of
the VB.NET app then I get 2 instance of the DLL loaded with completely
different values for the "static integer" in the DLL. I know that this was
quite an easy thing to achieve in VB6 via the project properties, but how
would I go about achieving this in Visual Studio .NET 2003 with a C++
project?

Thanks loads in advance!


Take a look at KB Q109619.

http://support.microsoft.com/default...b;en-us;109619

Tom
--
C++ FAQ: http://www.parashift.com/c++-faq-lite/
C FAQ: http://www.eskimo.com/~scs/C-faq/top.html
Nov 17 '05 #2
Nak
Thanks Tom, this looks like it is going to be most helpful.

Nak.

"tom_usenet" <to********@hotmail.com> wrote in message
news:fq********************************@4ax.com...
On Tue, 8 Jun 2004 10:53:01 +0100, "Nak" <a@a.com> wrote:
Hi there,

I am attempting to make a single instance DLL in C++. This means that Ionly want 1 copy to be loaded at any time and the DLL's data is shared
throughout processes.

For example, I have a VB.NET app connecting to my DLL and calling a
function called addOne in the DLL, this then adds 1 to a static integer inthe DLL and returns the value. The problem is that if I load 2 instances ofthe VB.NET app then I get 2 instance of the DLL loaded with completely
different values for the "static integer" in the DLL. I know that this wasquite an easy thing to achieve in VB6 via the project properties, but how
would I go about achieving this in Visual Studio .NET 2003 with a C++
project?

Thanks loads in advance!


Take a look at KB Q109619.

http://support.microsoft.com/default...b;en-us;109619

Tom
--
C++ FAQ: http://www.parashift.com/c++-faq-lite/
C FAQ: http://www.eskimo.com/~scs/C-faq/top.html

Nov 17 '05 #3

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

Similar topics

16
by: Elad | last post by:
Hi, I have an application that is made up of several executables. I need all these executables to use the same instance of an object. What is the best, most efficient way to approach this? ...
18
by: Steve Barnett | last post by:
I want to ensure that there is only ever one instance of my app running on a single PC at any time. I understand that I can achieve this by using a mutex and, if I can't take ownership of the...
7
by: jsale | last post by:
I have made an ASP.NET web application that connects to SQL Server, reading and writing data using classes. I was recommended to use session objects to store the data per user, because each user...
1
by: Maileen | last post by:
Hi, How can i do (and test) a single instance of my form ? thanks, Maileen
9
by: MrSpock | last post by:
1. Create a new Windows Application project. 2. Open the project properties and check "Make single instance application". 3. Build. 4. Go to the release folder and run the application. 5. Try to...
3
by: sadanjan | last post by:
Hi , Appreciate if someone can clarify if database Share Memory Limit (2 GB ) in Unix 32 bit boxes is the top limit for all the databases put together in a database or is it for each of the...
3
by: Mark Jerde | last post by:
VS 2005. When I google "CSharp single instance form" the returned pages usually use a Mutex or the VB.NET runtime library....
13
by: JohnQ | last post by:
Why would anyone write: class SomeThing // class littered with non-domain single-instancing code :( { private: SomeThing(); static SomeThing* pInstance_; public: static SomeThing*...
3
by: sklett | last post by:
I suspect the answer might be in one of the words of my subject, but here goes anyway. I'm working on a system that will execute a very long (300+) chain of task objects. Here is some quick...
5
by: Sarath | last post by:
I've to write a single instance class. there are different methods to control the single instance of a program. I've tried the following method class CSingleton { public: CSingleton&...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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...
0
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
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.