Solved

VB6 Not Responding

Posted on 2007-11-20
6
1,436 Views
Last Modified: 2008-02-01
I have an application that is sometimes required to process large sets of data.  While processing the status bar indicates the application's progress.

With larger datasets, the application becomes quite busy and appears to end-users as though it has stopped responding (them: did it crash? me: no).

With the current design, I *do not* want to use DoEvents:
- I do not want other events to be triggered
- I just want to avoid the title bar turning white (a signal of a 'Not Responding' application).

An example of the situation would be looping through a large set of data (from a map recordset) and populating a grid, or combobox with the data while displaying the progress in a status bar.

Thoughts (other than abandoning VB6)?
0
Comment
Question by:mecdesign
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 13

Expert Comment

by:Jeff Darling
ID: 20324594
it probably just needs to be forced to repaint periodically.  

progressbar1.refresh

I wouldn't put the refresh in after updating the progressbar1.value because then the progressbar will have a weird flicker to it. Maybe put it in a timer so that it only refreshes every once in a while to prevent flicker?
0
 
LVL 18

Accepted Solution

by:
Sethi earned 500 total points
ID: 20324694
You can also place a label control that says please wait while the processing is on and use a timer to make that label go on and off. This will make the user feel that something is on.
0
 
LVL 2

Expert Comment

by:andrewneely
ID: 20327563
you could try a me.refresh every so many iterations

Although it does slow down execution, I would be tempted to use doevents otherwise the system might be very sluggish for the user.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 17

Expert Comment

by:Shanmuga Sundaram
ID: 20328412
if your only problem is that your system slows down while using doevents then try using the doevents like this as given below function.

Private Declare Function GetQueueStatus Lib "user32" (ByVal qsFlags As Long) As Long

Function DoEvents2()
If GetQueueStatus(255) <> 0 Then DoEvents
End Function
or else

Try using a label control which updates as Sethi said
0
 

Author Comment

by:mecdesign
ID: 20328828
Currently, as the status is updated, I force the lable to update as well, eg:

...
frm.StatusBar.Panels(panelIndex).text = message
frm.StatusBar.Refresh
...


When the system is very busy and the interface locks up, the refresh command has no effect.

I am sure DoEvents would fix this, but there are known issues allowing user-generated events when processing certain things.  I will spare the details.

I will try combining some of the suggested ideas and see how that works and update you later with the results.  

If there are any other suggestions, they are welcome.
0
 

Author Comment

by:mecdesign
ID: 20412212
Since I cannot use DoEvents I will accept the alternative.

Thanks.
0

Featured Post

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Saving history changes to sub form 4 56
Microsoft Access combo box help 2 57
Child Form in front 4 65
Collapse and expand table in Word 2010 2 157
There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question