?
Solved

VB6 Not Responding

Posted on 2007-11-20
6
Medium Priority
?
1,471 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 2000 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses
Course of the Month8 days, 9 hours left to enroll

764 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