473,378 Members | 1,037 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,378 software developers and data experts.

Global shared values

I have an application that is one EXE with mutliple DLL's. In one of the
DLL's (libs.dll) that the EXE has refeneced, I have:

Public Class Globals
Public Shared gLogin as String
End Class

This variable is ued throughout my program in libs.dll, and other DLLs.

The user then starts up another occurance of the application. They login
and the gLogin variable is set.

Are the two programs using the same or different memory areas for this
global data? If either exit the software, should that do anything to the
other gLogin for the other program?

What are other people's thoughts on global variables. I know they aren't
great things to use, but I haven't figured out a clean method of passing
data around to different forms that may or may not get used.

Thanks.
Darin

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 20 '05 #1
1 1558
"Darin" <darin_nospam@nospamever> schrieb
I have an application that is one EXE with mutliple DLL's. In one of
the DLL's (libs.dll) that the EXE has refeneced, I have:

Public Class Globals
Public Shared gLogin as String
End Class

This variable is ued throughout my program in libs.dll, and other
DLLs.

The user then starts up another occurance of the application. They
login and the gLogin variable is set.

Are the two programs using the same or different memory areas for
this global data? If either exit the software, should that do
anything to the other gLogin for the other program?
No, processes don't share data. Look for "remoting" to interact between
processes.
What are other people's thoughts on global variables. I know they
aren't great things to use, but I haven't figured out a clean method
of passing data around to different forms that may or may not get
used.


There are no global variables. Variables are either shared or instance, and
they are accessible or not. I'd make a variable only shared if it can be
changed to any value without breaking consistence. To pass data between
objects, I'd pass the reference to the object around.

--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #2

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

Similar topics

3
by: Phil Lamey | last post by:
Hi All, I have the following code but for some reason I cannot get the Session_OnEnd event to fire. I am trying to limit the amount of connections a browser session can have. Where the...
1
by: Fred Iannon | last post by:
All, I am trying to figure out a clean solution to the following issues: (1) - We have a number of dlls/exes that need to have the same "values" for the various assembly attributes (like...
4
by: Dan Elliott | last post by:
Hello, Converting from a working C program to C++, I run into the following error: I have a header: (header.h) namespace shared{ ... struct X{ ...
33
by: MLH | last post by:
I've read some posts indicating that having tons of GV's in an Access app is a bad idea. Personally, I love GVs and I use them (possibly abuse them) all the time for everything imaginable - have...
6
by: Andrea Williams | last post by:
Where is the best place to put global variables. In traditional ASP I used to put all of them into an include file and include it in every page. Will the Global.aspx.cs do that same thing? ...
41
by: Miguel Dias Moura | last post by:
Hello, I am working on an ASP.NET / VB page and I created a variable "query": Sub Page_Load(sender As Object, e As System.EventArgs) Dim query as String = String.Empty ... query =...
3
by: Nathan | last post by:
Somebody help please, I am desperate for help as I've battled this problem for 3 days now! :( I have an application (NT Service) that uses 2 threads... one worker-thread (i.e. always running)...
5
by: Sandman | last post by:
I dont think I understand them. I've read the section on scope in the manual inside out. I'm running PHP 5.2.0 Here is the code I'm working on: //include_me.php <?php $MYVAR = array(); global...
15
by: =?Utf-8?B?UGF0Qg==?= | last post by:
Just starting to move to ASP.NET 2.0 and having trouble with the Global.asax code file. In 1.1 I could have a code behind file for the global.asax file. This allow for shared variables of the...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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

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.