473,320 Members | 1,955 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.

Sharing static data between projects

I have created an application that uses 3 parts: 1) a windows service
that distributes email 2) a form that configures the settings
(incoming address, outgoing address, etc) for that service and 3) a
form that acts as a report for how that service is doing (emails sent,
etc).

I want the report form (3) to be updated real time with the service's
progress. Right now I'm using the Singleton pattern for storing the
settings & data that the service uses (as it sends an email it updates
that iEmailsSent variable of that singleton. I read that static
variables are created once per namespace so I have renamed all the
projects to a single namespace so that they can share those static
variables. Now I figure that as the service performs its duties, I
should be able to see the results of those in real time via my report
form by just referencing that Singleton settings object, since that is
a static variable that should exist to all three of these projects
simultaniously.

However, when I test this (I have a windows form that does the same
thing as the service for debugging purposes) I open the service tester
form in debug mode and run it so that it sends a few email and updates
the Singleton variable, then while that's still open I open my report
which should be reading from that same static instance and it doesn't
see any of the info -- they're not "sharing".

Should this work and I just need to debug? Is the problem that I'm
running one in VS debug mode and one in native windows? Is there
something fundamentally wrong with the way I'm doing this? Is there
something I'm missing?

Thanks,
Noah

Mar 2 '07 #1
0 1060

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

Similar topics

1
by: Jay W NOjwalkerSPAM | last post by:
I have some class objects each in separate projects that belong to a solution. The projects reference one another within that solution. The 'main' function calls the other procedure/function...
1
by: Simon Neve | last post by:
Hello, This question is related to sharing .Net projects across solutions and is reposted from the SourceSafe group. We have several different solutions and want to share common assemblies...
7
by: Dan | last post by:
I'd like to have a set of more-or-less common code which I want to use for both desktop and smart device projects. I have two questions: 1. How can I set up conditional compile directives for...
16
by: Robert W. | last post by:
I'm building a solution that has 1 component for the Desktop and 1 component for the Pocket PC. (Though this isn't a mobile question). I have a data library that will be shared on both platforms....
0
by: Darren Oakey | last post by:
G'day - is there anyway of sharing the Session data across two different ASP.Net projects? Basically, I'm jumping from a page in one to a page in another, and I'd like to have the data flit...
3
by: grooby | last post by:
I would like to develop an asp.net Web application using muliple web projects under one solution file and share the session information between web applications( or projects). Is this possible?
0
by: rcolby | last post by:
Hi, A little advice on code sharing across projects, namespaces and dll's for references. I've got an application that is split between three different projects (one for a service, one for...
4
by: radiax | last post by:
Iam trying to find a simple solution for sharing data between windows applications( apart of using file system or remoting or MMF) . I tried using class library by making data members "shared" but...
2
by: David | last post by:
How do I share code across files in C#, without including a reference to a class library. Here's what I want to do. I have a device I want to talk to. It's a machine in a factory. It can talk...
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...
0
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
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...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
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)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
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.