Solved

Application get hang in VB 6.0

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Input past end of file vbs script 9 82
Access 2016 VB code 9 103
using Access 8 59
Prevent checkbox click event occur while editing it in vb6 8 33
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…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…

920 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

16 Experts available now in Live!

Get 1:1 Help Now