473,769 Members | 5,724 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Trouble with Identically-Named Variables

Hello,

I'm running into a strange problem involving identically-named
variables in multiple projects. I'm using Visual Studio 2005, and have
a solution with three projects under it. Two of the three projects
have variables with the same name. These variables are both global to
their class. The problem is that when variable "foo" in Project 1 is
set to "bar," variable foo in Project 2 also immediately takes on value
bar. This occurs regardless of whether foo is references simply as
foo, or as this.foo.

I can't figure out how this is occuring, as the projects do not contain
references to each other (they are completely independent projects),
but the debugger shows that this is the case and when running without
debugging I get strange behavior that I suspect is caused by this.
It's a simple matter to rename one project's variable for now, but I
would like a more permanent solution.

Thanks for your help!

Feb 27 '06 #1
3 1219
"Robert Thompson" <rt**********@h otmail.com> wrote in message
I can't figure out how this is occuring, as the projects do not contain
references to each other (they are completely independent projects),
but the debugger shows that this is the case and when running without
debugging I get strange behavior that I suspect is caused by this.
It's a simple matter to rename one project's variable for now, but I
would like a more permanent solution.


Does renaming help? Are you using any of the variables in API calls? Are
these 2 projects running in the same process?

Michael
Feb 27 '06 #2
Hi Robert,
can you post a small code example which exhibits the problem, there could
be many reasons for what you are seeing and an example would make it clearer.

Thanks
Mark
http://www.markdawson.org
"Robert Thompson" wrote:
Hello,

I'm running into a strange problem involving identically-named
variables in multiple projects. I'm using Visual Studio 2005, and have
a solution with three projects under it. Two of the three projects
have variables with the same name. These variables are both global to
their class. The problem is that when variable "foo" in Project 1 is
set to "bar," variable foo in Project 2 also immediately takes on value
bar. This occurs regardless of whether foo is references simply as
foo, or as this.foo.

I can't figure out how this is occuring, as the projects do not contain
references to each other (they are completely independent projects),
but the debugger shows that this is the case and when running without
debugging I get strange behavior that I suspect is caused by this.
It's a simple matter to rename one project's variable for now, but I
would like a more permanent solution.

Thanks for your help!

Feb 27 '06 #3
Robert Thompson wrote:
I'm running into a strange problem involving identically-named
variables in multiple projects. I'm using Visual Studio 2005, and have
a solution with three projects under it. Two of the three projects
have variables with the same name. These variables are both global to
their class. The problem is that when variable "foo" in Project 1 is
set to "bar," variable foo in Project 2 also immediately takes on value
bar. This occurs regardless of whether foo is references simply as
foo, or as this.foo.

I can't figure out how this is occuring, as the projects do not contain
references to each other (they are completely independent projects),
but the debugger shows that this is the case and when running without
debugging I get strange behavior that I suspect is caused by this.
It's a simple matter to rename one project's variable for now, but I
would like a more permanent solution.


It sounds unlikely to be happening as you have described - I suspect
you have debugger issues.

As Mark said, if you could post a short but complete program which
demonstrates the problem, that would help enormously.

Jon

Feb 27 '06 #4

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

Similar topics

2
1886
by: James | last post by:
Hi I am having some trouble getting a asp page to load. Im a noob to the asp side. I have followed knowledege base Article 301305. I am running 2000 adv, IIS 5.0 I have the following settings to the folder that has the asp. Application settings
4
3846
by: Jacek Dziedzic | last post by:
Hi! First of all, I hope my problem is not too loosely tied to the "standard C++" that is the topic of this group. I have some code that exhibits a strange behaviour: on one computer, where I compile with g++-3.2 it compiles and works fine, on another computer, whether I compile with g++-3.0 or g++-2.95 (unfortunately 3.2 is not available) it crashes with a segmentation violation on runtime.
0
1558
by: Paul C | last post by:
Hello, everybody. I am having trouble running some of the VS.NET samples, specifically the CarSelector web app, which is very simple. The symptom is that the web controls (drop down listboxes and such) do not render correctly. They're almost invisible, and the others don't work at all, but just show their caption text. Not what should happen This strange behavior is happening on my new laptop, which came with XP Home, but I immediately...
0
1508
by: Alexandre Jaquet | last post by:
Hi does anybody know how to solve my trouble, when I try to create a MS Office project I always got trouble. I can't create office project when I try to create one vs.net restart ... :s
1
2003
by: Jim Bancroft | last post by:
Hi everyone, I'm running into a problem with my ASP.Net application. I've just created a new aspx page which uses some new components of mine that inherit from ServicedComponent and are designed to run under COM+. This page works fine, unless I get fancy and hit my browser's refresh button quickly, as a test. Then, what I see happen is the transactions pile up and my ASP.Net "current requests" do the same. This happens even with two...
6
3806
by: Daniel Walzenbach | last post by:
Hi, I have a web application which sometimes throws an “out of memory” exception. To get an idea what happens I traced some values using performance monitor and got the following values (for one day): \\FFDS24\ASP.NET Applications(_LM_W3SVC_1_Root_ATV2004)\Errors During Execution: 7 \\FFDS24\ASP.NET Apps v1.1.4322(_LM_W3SVC_1_Root_ATV2004)\Compilations
3
5006
by: Olivier BESSON | last post by:
Hello, I have a web service of my own on a server (vb.net). I must declare it with SoapRpcMethod to be used with JAVA. This is a simple exemple method of my vb source : >************************************************************************ > <WebMethod(), System.Web.Services.Protocols.SoapRpcMethod()> _ > Public Function HelloWorld() As > <System.Xml.Serialization.SoapElementAttribute("return")> String
2
1556
by: JLupear | last post by:
I am having trouble with my code again, I had prepared a question and the code to upload, however I am having trouble posting it, are there limits to the amount of lines you can post? I split it into 4 parts and am still having trouble uploading it. What am I doing wrong?
0
1870
by: daveman | last post by:
Hello, I'm encountering a "Blue Screen of Death" when I try to send data to a bluetooth sensor via a serial port, using the MSCOMM ActiveX object. I was wondering if anyone has any ideas how to fix the problem. As some background, I am trying to use VB to communicate with a Wi-Tilt bluetooth accelerometer, a sensor which sends data over a COM serial port. I have no problem talking to the device in Hyperterminal; it streams data into...
0
1675
by: mrchatgroup | last post by:
news from http://www.mrchat.net/myblog/myblog/small-accidents-mean-big-trouble-for-supercollider.html Small Accidents Mean Big Trouble for Supercollider Image Scientists expect startup glitches in the massive, complex machines they use to smash atoms.
0
9423
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10045
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9994
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7408
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 presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6673
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5298
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3958
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3561
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.