?
Solved

Application get hang in VB 6.0

Posted on 2006-11-12
6
Medium Priority
?
188 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 1000 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

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…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

777 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