Solved

Application get hang in VB 6.0

Posted on 2006-11-12
6
173 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
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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 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…

708 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now