Solved

Application get hang in VB 6.0

Posted on 2006-11-12
6
181 Views
Last Modified: 2010-04-30
Hello

I have made a application in VB 6.0 which os downloading n number files of from internet. I have put two progress bars in my application first one shows that number of file downloading out of total files, and second progress bar shows that how much percentage of current file has been downloaded. Now everything is going fine. But the problem arise when my form gets deactivate, like i open another application and when i will come back to this is form has become white. When it start to come the title is having (Not Responding) with it. But after some time the files get downloaded this means that the process was working only form stp display. I am thinking that Multithreading can be a better solution for these problem. But i don't know how multithreading can be implemented in VB 6.0 . If anyone can gve better solution then please tell.

Thanx In Advance
Gaurav..
0
Comment
Question by:momentuminfotech
[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 3

Expert Comment

by:herreruud
ID: 17928640
Do you have any events triggered by either "Activate" or "Deactivate" in your form?

If not, I'd say you probably need to add DoEvents in your code. This frees time in your App that will allow windows to (amongst other things) redraw your form.

An example:

Do While Some_Statement

  'Execute some code
  'Execute code to show progress

  DoEvents

Loop
0
 
LVL 11

Accepted Solution

by:
Dany Balian earned 250 total points
ID: 17932763
i agree with herreruud on the doevents in the loop...

if u dont want to do doevents on every loop

u can try something like

do while some_statement
i=i+1

if i mod 10=0 then doevents
loop


one more thing you can try is to add the following on the form_Activate:
me.refresh


hope this helps,

cheers

dan
0
 
LVL 10

Expert Comment

by:Kinger247
ID: 17934802
Hi momentuminfotech,

You need to put:

DoEvents
Me.Refresh

After updating the progress bars.
0

Featured Post

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

728 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