Sharing static data between projects

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



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

.



Relevant Pages

  • Re: vfp 9 printer setup overrides printer driver
    ... yourself up a second printer in windows, ... this works for all the settings except the portrait 180 setting. ... also assume you are using the report writer? ... to modify the report in foxpro, and from the menus in there make the ...
    (microsoft.public.fox.programmer.exchange)
  • Re: Reports Wont Print Full Page Width
    ... In Windows, you have to define a custom page on the computer that the ... When I go to print the report it only prints to 8 1/2 width. ... I used landscape settings.. ...
    (microsoft.public.fox.vfp.reports.printing)
  • Re: Delphi 2005 upgrade 2... not recommended
    ... Why don't you turn of the report stuff in windows. ... There are settings for ... I turn it off the first time it appeared. ...
    (borland.public.delphi.non-technical)
  • Re: Serious search problem
    ... "Robin Bignall" wrote: ... and ran all of the virus and malware checkers again. ... On the IE properties windows you will see these Taps: ... Click Privacy Tab and make sure your Privacy settings at least Medium High, ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: SunJavaScript/Flash/IE6 Not Working right! Help?
    ... I went to that site with my ZAPro settings as is - was able to view the ... I even tried lowering Internet Zone ... Using the Windows Firewall is, for me, not an option. ... The safe Mode test sort of implicates ZA. ...
    (microsoft.public.windows.inetexplorer.ie6.setup)