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

Integer not incrementing in Windows Vista, is in XP Pro/Home

I have a Net 2.0 app in VB that has code like this:

Dim intA as Integer
Dim intB as Integer
dim myList as new List(Of String)

intA = 10
intB = 20

.... code to fill the list ....

intA = intA + 1
intB = intB + 1

Then I insert into a list of type String, like so:

myList.Insert("the value being inserted here is " & intA, intB)

On XP Pro/Home, the list inserts using intA = 11 and intB = 21.
But on Vista, my beta users report that the Insert is using the previous
values 10 and 20 respectively. I am unable to recreate this problem myself
on Vista.

Does anyone have insight as to why this is happening? Thank you in advance.
Oct 27 '07 #1
3 1253
Sounds odd, I suspect it is something else in the app or the way the
customers use it that is affecting this.
The best thing would be to run your app through the debugger at a 'tame'
customers site and see wether the integers are not incrementing or are being
added to the list incorrectly

Oh, and turn Option Strict on!

Guy

"Mike K" wrote:
I have a Net 2.0 app in VB that has code like this:

Dim intA as Integer
Dim intB as Integer
dim myList as new List(Of String)

intA = 10
intB = 20

... code to fill the list ....

intA = intA + 1
intB = intB + 1

Then I insert into a list of type String, like so:

myList.Insert("the value being inserted here is " & intA, intB)

On XP Pro/Home, the list inserts using intA = 11 and intB = 21.
But on Vista, my beta users report that the Insert is using the previous
values 10 and 20 respectively. I am unable to recreate this problem myself
on Vista.

Does anyone have insight as to why this is happening? Thank you in advance.
Oct 28 '07 #2
Mike K wrote:
I have a Net 2.0 app in VB that has code like this:

Dim intA as Integer
Dim intB as Integer
dim myList as new List(Of String)

intA = 10
intB = 20

... code to fill the list ....

intA = intA + 1
intB = intB + 1

Then I insert into a list of type String, like so:

myList.Insert("the value being inserted here is " & intA, intB)
You are certainly not.

The Insert method takes two parameters, where the first is an integer
and the second is a string.
On XP Pro/Home, the list inserts using intA = 11 and intB = 21.
But on Vista, my beta users report that the Insert is using the previous
values 10 and 20 respectively. I am unable to recreate this problem myself
on Vista.

Does anyone have insight as to why this is happening? Thank you in advance.
Without seeing some of the code that you are actually using, it's very
hard to even have an idea about what's happening.

--
Göran Andersson
_____
http://www.guffa.com
Oct 28 '07 #3
Mike K wrote:
>
"Henning Krause [MVP - Exchange]" wrote:
>Hello,

are you, by any chance, doing this stuff in paralell on multiple threads?

If so, you must protect access to the list with some sort of locking
mechanism (SyncLock statement in VB). Otherwise you might end up with a
race condition which might or might not occur on a single processor machine.

Kind regards,
Henning Krause

Henning, thanks for replying. The problem code is on the main thread. I do
have another thread on which most my other methods run on, but they don't
read or write the 2 problem integer variables.

Even though it's on the main thread, I'll try wrapping the code in SyncLock
anyway to see if that makes a difference.

Thanks.
Putting a SyncLock around a single piece of code only has any effect if
more than one thread is using that code. If only the main thread is
using that code, it doesn't make any difference.

You can spend the time to try it, though. If it makes any difference,
there are two possibilities. Either that more than one thread is using
the code, which means that there is something wrong with your threads,
or that it changed the execution time, which means that it's a race
condition between threads.

--
Göran Andersson
_____
http://www.guffa.com
Oct 29 '07 #4

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

Similar topics

7
by: JL | last post by:
Hello, I've a strange problem with Windows Vista, running an ASP page on local machine (http://localhost/test.asp), the page does not give me any error but the asp code is not executed (simple...
6
by: j2ee.singh | last post by:
Hi, I'm looking to buy a new laptop primarily to learn & practice .NET and C#. My Question is: Is there any requirement for .NET and C# in terms of the following Operating Systems: -...
3
cjbrx3115
by: cjbrx3115 | last post by:
Hello! I have a wireless network with 1 Windows XP Pro, 1 Windows XP Home, and 1 Windows Vista Home Premium. I can connect to any computer in the workgroup and see its shared files, except for the...
4
by: =?Utf-8?B?TWlrZSBSaWRlcg==?= | last post by:
Can i have windows vista home premium english version as the base and install the windows vista ultimate as an upgrade in the Spanish language. Will it work, or will i have any problem.
1
cjbrx3115
by: cjbrx3115 | last post by:
Hey everyone! I had always wanted DreamScene on my computer, but found out that it can only be done on Windows Vista Ultimate (I have Home Premium.) I was wondering if any of you knew of a place that...
4
by: =?Utf-8?B?WmVlbmFpZGE=?= | last post by:
I get the error <b>It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being...
4
by: Arek | last post by:
Hi, How to detect Windows version and .NET version? I mean I want to know if user is using Windows 2000, XP, Vista and which Service Pack and version (XP Home, XP Pro, Vista Home Basic, Vista...
12
by: Alan M Dunsmuir | last post by:
After having worked with Apache/MySQL/PHP for a year or so under Linux I need, purely for convenience, to set up a parallel platform under Windows. Unfortunately, since I last did this (using...
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: 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?
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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.