Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old June 22nd, 2009, 09:13 PM
Rory Butler Rory Butler is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2008
Posts: 19 Rory Butler User rank is Sergeant Major (2000 - 5000 Reputation Level)Rory Butler User rank is Sergeant Major (2000 - 5000 Reputation Level)Rory Butler User rank is Sergeant Major (2000 - 5000 Reputation Level)Rory Butler User rank is Sergeant Major (2000 - 5000 Reputation Level)Rory Butler User rank is Sergeant Major (2000 - 5000 Reputation Level)Rory Butler User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 4 h 27 m 52 sec
Reputation Power: 0
VB2008 program freezes

I've seen great advice for VB6 freezing, but I have the same problem in VB2008, and there ain't no doevents etc to make sure background things get tidied up. I have a small program which loops through each of the permutations of the digits 0123456789 - doing a test or three on each possibility. If I set the program running then click somewhere else on the screen the program appears to freeze but is actually still running. (I have the same problem with a larger database management program - so the problem is inadequate programming on my part).

I've got a screen refresh after each list update (I use a list to report every millionth test) but it still looks up - even if I put a me.enabled = false at the start of the routine.

Can anyone shed light here for me please?

Reply With Quote
  #2  
Old June 22nd, 2009, 11:02 PM
medialint's Avatar
medialint medialint is offline
Type Cast Exception
Click here for more information.
 
Join Date: Apr 2004
Location: Oakland, CA
Posts: 13,953 medialint User rank is General 68th Grade (Above 100000 Reputation Level)medialint User rank is General 68th Grade (Above 100000 Reputation Level)medialint User rank is General 68th Grade (Above 100000 Reputation Level)medialint User rank is General 68th Grade (Above 100000 Reputation Level)medialint User rank is General 68th Grade (Above 100000 Reputation Level)medialint User rank is General 68th Grade (Above 100000 Reputation Level)medialint User rank is General 68th Grade (Above 100000 Reputation Level)medialint User rank is General 68th Grade (Above 100000 Reputation Level)medialint User rank is General 68th Grade (Above 100000 Reputation Level)medialint User rank is General 68th Grade (Above 100000 Reputation Level)medialint User rank is General 68th Grade (Above 100000 Reputation Level)medialint User rank is General 68th Grade (Above 100000 Reputation Level)medialint User rank is General 68th Grade (Above 100000 Reputation Level)medialint User rank is General 68th Grade (Above 100000 Reputation Level)medialint User rank is General 68th Grade (Above 100000 Reputation Level)medialint User rank is General 68th Grade (Above 100000 Reputation Level)  Folding Points: 319635 Folding Title: Super Ultimate Folder - Level 1Folding Points: 319635 Folding Title: Super Ultimate Folder - Level 1Folding Points: 319635 Folding Title: Super Ultimate Folder - Level 1Folding Points: 319635 Folding Title: Super Ultimate Folder - Level 1Folding Points: 319635 Folding Title: Super Ultimate Folder - Level 1Folding Points: 319635 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 5 Months 3 Weeks 2 Days 2 h 22 m 56 sec
Reputation Power: 5539
Facebook
Try um ...

Application.DoEvents

:-)
__________________
medialint.com


"Beware of the man who works hard to learn something, learns it, and finds himself no wiser than before. He is full of murderous resentment of people who are ignorant without having come by their ignorance the hard way."
- Vonnegut - Cat's Cradle, 1963

Reply With Quote
  #3  
Old June 22nd, 2009, 11:18 PM
Rory Butler Rory Butler is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2008
Posts: 19 Rory Butler User rank is Sergeant Major (2000 - 5000 Reputation Level)Rory Butler User rank is Sergeant Major (2000 - 5000 Reputation Level)Rory Butler User rank is Sergeant Major (2000 - 5000 Reputation Level)Rory Butler User rank is Sergeant Major (2000 - 5000 Reputation Level)Rory Butler User rank is Sergeant Major (2000 - 5000 Reputation Level)Rory Butler User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 4 h 27 m 52 sec
Reputation Power: 0
Ignorance revealed

Duh!

Many thanks. That solved the problem.

As you gathered and were kind enough not to point out, I'm very new to VB2008 and am still finding my way through.

Thanks again.

Rory
Comments on this post
medialint agrees: thanks for the thanks

Reply With Quote
  #4  
Old June 22nd, 2009, 11:31 PM
medialint's Avatar
medialint medialint is offline
Type Cast Exception
Click here for more information.
 
Join Date: Apr 2004
Location: Oakland, CA
Posts: 13,953 medialint User rank is General 68th Grade (Above 100000 Reputation Level)medialint User rank is General 68th Grade (Above 100000 Reputation Level)medialint User rank is General 68th Grade (Above 100000 Reputation Level)medialint User rank is General 68th Grade (Above 100000 Reputation Level)medialint User rank is General 68th Grade (Above 100000 Reputation Level)medialint User rank is General 68th Grade (Above 100000 Reputation Level)medialint User rank is General 68th Grade (Above 100000 Reputation Level)medialint User rank is General 68th Grade (Above 100000 Reputation Level)medialint User rank is General 68th Grade (Above 100000 Reputation Level)medialint User rank is General 68th Grade (Above 100000 Reputation Level)medialint User rank is General 68th Grade (Above 100000 Reputation Level)medialint User rank is General 68th Grade (Above 100000 Reputation Level)medialint User rank is General 68th Grade (Above 100000 Reputation Level)medialint User rank is General 68th Grade (Above 100000 Reputation Level)medialint User rank is General 68th Grade (Above 100000 Reputation Level)medialint User rank is General 68th Grade (Above 100000 Reputation Level)  Folding Points: 319635 Folding Title: Super Ultimate Folder - Level 1Folding Points: 319635 Folding Title: Super Ultimate Folder - Level 1Folding Points: 319635 Folding Title: Super Ultimate Folder - Level 1Folding Points: 319635 Folding Title: Super Ultimate Folder - Level 1Folding Points: 319635 Folding Title: Super Ultimate Folder - Level 1Folding Points: 319635 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 5 Months 3 Weeks 2 Days 2 h 22 m 56 sec
Reputation Power: 5539
Facebook
Actually I never used VB 2005 much, and never used VB 2008 I'm mostly C# these days but I couldn't sleep not knowing the answer myself ;-) I'm an old VB6/VBA guy too when it comes to VB.

Reply With Quote
  #5  
Old June 22nd, 2009, 11:56 PM
medialint's Avatar
medialint medialint is offline
Type Cast Exception
Click here for more information.
 
Join Date: Apr 2004
Location: Oakland, CA
Posts: 13,953 medialint User rank is General 68th Grade (Above 100000 Reputation Level)medialint User rank is General 68th Grade (Above 100000 Reputation Level)medialint User rank is General 68th Grade (Above 100000 Reputation Level)medialint User rank is General 68th Grade (Above 100000 Reputation Level)medialint User rank is General 68th Grade (Above 100000 Reputation Level)medialint User rank is General 68th Grade (Above 100000 Reputation Level)medialint User rank is General 68th Grade (Above 100000 Reputation Level)medialint User rank is General 68th Grade (Above 100000 Reputation Level)medialint User rank is General 68th Grade (Above 100000 Reputation Level)medialint User rank is General 68th Grade (Above 100000 Reputation Level)medialint User rank is General 68th Grade (Above 100000 Reputation Level)medialint User rank is General 68th Grade (Above 100000 Reputation Level)medialint User rank is General 68th Grade (Above 100000 Reputation Level)medialint User rank is General 68th Grade (Above 100000 Reputation Level)medialint User rank is General 68th Grade (Above 100000 Reputation Level)medialint User rank is General 68th Grade (Above 100000 Reputation Level)  Folding Points: 319635 Folding Title: Super Ultimate Folder - Level 1Folding Points: 319635 Folding Title: Super Ultimate Folder - Level 1Folding Points: 319635 Folding Title: Super Ultimate Folder - Level 1Folding Points: 319635 Folding Title: Super Ultimate Folder - Level 1Folding Points: 319635 Folding Title: Super Ultimate Folder - Level 1Folding Points: 319635 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 5 Months 3 Weeks 2 Days 2 h 22 m 56 sec
Reputation Power: 5539
Facebook
Btw one more post and your rep power should be around 45 or so by now :-)

Reply With Quote
  #6  
Old June 23rd, 2009, 11:31 AM
zynder's Avatar
zynder zynder is offline
Not much of a contributor
Dev Shed Novice (500 - 999 posts)
 
Join Date: Aug 2006
Location: Hidden
Posts: 988 zynder User rank is General (90000 - 100000 Reputation Level)zynder User rank is General (90000 - 100000 Reputation Level)zynder User rank is General (90000 - 100000 Reputation Level)zynder User rank is General (90000 - 100000 Reputation Level)zynder User rank is General (90000 - 100000 Reputation Level)zynder User rank is General (90000 - 100000 Reputation Level)zynder User rank is General (90000 - 100000 Reputation Level)zynder User rank is General (90000 - 100000 Reputation Level)zynder User rank is General (90000 - 100000 Reputation Level)zynder User rank is General (90000 - 100000 Reputation Level)zynder User rank is General (90000 - 100000 Reputation Level)zynder User rank is General (90000 - 100000 Reputation Level)zynder User rank is General (90000 - 100000 Reputation Level)zynder User rank is General (90000 - 100000 Reputation Level)zynder User rank is General (90000 - 100000 Reputation Level)zynder User rank is General (90000 - 100000 Reputation Level)  Folding Points: 192752 Folding Title: Super Ultimate Folder - Level 1Folding Points: 192752 Folding Title: Super Ultimate Folder - Level 1Folding Points: 192752 Folding Title: Super Ultimate Folder - Level 1Folding Points: 192752 Folding Title: Super Ultimate Folder - Level 1Folding Points: 192752 Folding Title: Super Ultimate Folder - Level 1Folding Points: 192752 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 1 Week 5 Days 3 h 29 m 7 sec
Reputation Power: 1002
Send a message via Yahoo to zynder
Facebook
Quote:
Originally Posted by medialint
Try um ...

Application.DoEvents

:-)


Classic. It's one way of saying, use quad core with 8G of memory when using VB2008.

Reply With Quote
  #7  
Old June 23rd, 2009, 12:04 PM
MadDogBrown MadDogBrown is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Mar 2009
Posts: 730 MadDogBrown User rank is Colonel (50000 - 60000 Reputation Level)MadDogBrown User rank is Colonel (50000 - 60000 Reputation Level)MadDogBrown User rank is Colonel (50000 - 60000 Reputation Level)MadDogBrown User rank is Colonel (50000 - 60000 Reputation Level)MadDogBrown User rank is Colonel (50000 - 60000 Reputation Level)MadDogBrown User rank is Colonel (50000 - 60000 Reputation Level)MadDogBrown User rank is Colonel (50000 - 60000 Reputation Level)MadDogBrown User rank is Colonel (50000 - 60000 Reputation Level)MadDogBrown User rank is Colonel (50000 - 60000 Reputation Level)MadDogBrown User rank is Colonel (50000 - 60000 Reputation Level)MadDogBrown User rank is Colonel (50000 - 60000 Reputation Level)MadDogBrown User rank is Colonel (50000 - 60000 Reputation Level) 
Time spent in forums: 1 Week 1 Day 3 h 40 m 5 sec
Reputation Power: 516
Quote:
Originally Posted by zynder
Classic. It's one way of saying, use quad core with 8G of memory when using VB2008.

No, actually it's one way of pointing out that a single threaded application cannot be expected to have a responsive UI when computations are being performed.
Comments on this post
medialint agrees!

Reply With Quote
  #8  
Old June 24th, 2009, 01:37 AM
zynder's Avatar
zynder zynder is offline
Not much of a contributor
Dev Shed Novice (500 - 999 posts)
 
Join Date: Aug 2006
Location: Hidden
Posts: 988 zynder User rank is General (90000 - 100000 Reputation Level)zynder User rank is General (90000 - 100000 Reputation Level)zynder User rank is General (90000 - 100000 Reputation Level)zynder User rank is General (90000 - 100000 Reputation Level)zynder User rank is General (90000 - 100000 Reputation Level)zynder User rank is General (90000 - 100000 Reputation Level)zynder User rank is General (90000 - 100000 Reputation Level)zynder User rank is General (90000 - 100000 Reputation Level)zynder User rank is General (90000 - 100000 Reputation Level)zynder User rank is General (90000 - 100000 Reputation Level)zynder User rank is General (90000 - 100000 Reputation Level)zynder User rank is General (90000 - 100000 Reputation Level)zynder User rank is General (90000 - 100000 Reputation Level)zynder User rank is General (90000 - 100000 Reputation Level)zynder User rank is General (90000 - 100000 Reputation Level)zynder User rank is General (90000 - 100000 Reputation Level)  Folding Points: 192752 Folding Title: Super Ultimate Folder - Level 1Folding Points: 192752 Folding Title: Super Ultimate Folder - Level 1Folding Points: 192752 Folding Title: Super Ultimate Folder - Level 1Folding Points: 192752 Folding Title: Super Ultimate Folder - Level 1Folding Points: 192752 Folding Title: Super Ultimate Folder - Level 1Folding Points: 192752 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 1 Week 5 Days 3 h 29 m 7 sec
Reputation Power: 1002
Send a message via Yahoo to zynder
Facebook
Quote:
Originally Posted by MadDogBrown
No, actually it's one way of pointing out that a single threaded application cannot be expected to have a responsive UI when computations are being performed.


Wow thanks for the explanation. Now you made me look dumb.

Reply With Quote
  #9  
Old June 24th, 2009, 08:27 AM
MadDogBrown MadDogBrown is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Mar 2009
Posts: 730 MadDogBrown User rank is Colonel (50000 - 60000 Reputation Level)MadDogBrown User rank is Colonel (50000 - 60000 Reputation Level)MadDogBrown User rank is Colonel (50000 - 60000 Reputation Level)MadDogBrown User rank is Colonel (50000 - 60000 Reputation Level)MadDogBrown User rank is Colonel (50000 - 60000 Reputation Level)MadDogBrown User rank is Colonel (50000 - 60000 Reputation Level)MadDogBrown User rank is Colonel (50000 - 60000 Reputation Level)MadDogBrown User rank is Colonel (50000 - 60000 Reputation Level)MadDogBrown User rank is Colonel (50000 - 60000 Reputation Level)MadDogBrown User rank is Colonel (50000 - 60000 Reputation Level)MadDogBrown User rank is Colonel (50000 - 60000 Reputation Level)MadDogBrown User rank is Colonel (50000 - 60000 Reputation Level) 
Time spent in forums: 1 Week 1 Day 3 h 40 m 5 sec
Reputation Power: 516
Quote:
Originally Posted by zynder
Now you made me look dumb.

Not my intent.

Application.DoEvents causes the message loop to process any messages in the queue.

Because of this, it is possible to have re-entrancy issues if it is called from within an event handler; see this blog post for an example of that:

http://www.codinghorror.com/blog/archives/000370.html

Reply With Quote
  #10  
Old June 25th, 2009, 12:37 PM
zynder's Avatar
zynder zynder is offline
Not much of a contributor
Dev Shed Novice (500 - 999 posts)
 
Join Date: Aug 2006
Location: Hidden
Posts: 988 zynder User rank is General (90000 - 100000 Reputation Level)zynder User rank is General (90000 - 100000 Reputation Level)zynder User rank is General (90000 - 100000 Reputation Level)zynder User rank is General (90000 - 100000 Reputation Level)zynder User rank is General (90000 - 100000 Reputation Level)zynder User rank is General (90000 - 100000 Reputation Level)zynder User rank is General (90000 - 100000 Reputation Level)zynder User rank is General (90000 - 100000 Reputation Level)zynder User rank is General (90000 - 100000 Reputation Level)zynder User rank is General (90000 - 100000 Reputation Level)zynder User rank is General (90000 - 100000 Reputation Level)zynder User rank is General (90000 - 100000 Reputation Level)zynder User rank is General (90000 - 100000 Reputation Level)zynder User rank is General (90000 - 100000 Reputation Level)zynder User rank is General (90000 - 100000 Reputation Level)zynder User rank is General (90000 - 100000 Reputation Level)  Folding Points: 192752 Folding Title: Super Ultimate Folder - Level 1Folding Points: 192752 Folding Title: Super Ultimate Folder - Level 1Folding Points: 192752 Folding Title: Super Ultimate Folder - Level 1Folding Points: 192752 Folding Title: Super Ultimate Folder - Level 1Folding Points: 192752 Folding Title: Super Ultimate Folder - Level 1Folding Points: 192752 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 1 Week 5 Days 3 h 29 m 7 sec
Reputation Power: 1002
Send a message via Yahoo to zynder
Facebook
no offense but i know what doEvents does.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming > VB2008 program freezes


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump




 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 




© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 2 Hosted by Hostway
Stay green...Green IT