• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1515
  • Last Modified:

VB6 Not Responding

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
mecdesign
Asked:
mecdesign
1 Solution
 
Jeff DarlingDeveloper AnalystCommented:
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
 
SethiCommented:
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
 
andrewneelyCommented:
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!

 
Shanmuga SundaramCommented:
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
 
mecdesignAuthor Commented:
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
 
mecdesignAuthor Commented:
Since I cannot use DoEvents I will accept the alternative.

Thanks.
0

Featured Post

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!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now