473,698 Members | 2,379 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1268
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
8099
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 code : <% response.write("hello") %), it show me a blank page, I think I've put all the setttings correctly, but maybe I must do something obvious to fix that. Anyone can help me ??
6
4275
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: - Windows Vista Home Basic - Windows Vista Business
3
3073
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 Windows Vista computer. The Vista computer does show up in the workgroup, but whenever I try and open the computer (via one of the XP computers) I always get an error message saying "You cannot connect to this computer. You do not have permission to...
4
1757
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
1483
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 I can get DreamScene for Home Premium. I tried this one install thing, but the directions were too confusing and didn't make sense, considering the thing didn't even work. I also tried DreamScape, but it said "You must have Windows Vista Ultimate to...
4
1608
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 configured as an application in IIS. </b> trying to run my asp.net app. How do I fix the virtual dir problem in Vista (Home Basic)???
4
14179
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 Premium, etc.). Is there any easy way to retrive this information? I'm wondering if all modern Windows version (2000, XP, 2003, Vista) has .NET installed by default or do I need to implement such a feature in Win32 instead of .NET?
12
2588
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 Windows XP Pro) I've moved on to Windows Vista (Home Premium). MySQL and Apache2 have both installed satisfactorily, but I'm having problems with PHP5. I downloaded the PHP5 Windows installer (the .msi file) for 32-bit Windows, which is supposed...
0
8675
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9029
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
8897
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
6521
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
4370
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
4619
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3050
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
2331
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2002
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.