Solved

Sleep the Process

Posted on 2001-06-07
9
1,277 Views
Last Modified: 2007-11-27
How can i stop the process for some seconds in  VB6.0 ?  
0
Comment
Question by:vinaikk
[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
  • 3
  • 3
  • 2
  • +1
9 Comments
 
LVL 4

Expert Comment

by:joachimc
ID: 6162920
Sleep(5000)

to sleep in 5 secs..

/Joachim
0
 
LVL 19

Expert Comment

by:BrianGEFF719
ID: 6162937
use the sleep api, call it like this...

call sleep(5000) '1000 = 1 second
0
 
LVL 52

Expert Comment

by:Ryan Chong
ID: 6162941
Hi, to use Sleep(n) , n = miliseconds. You need to add this API first:

Private Declare Sub Sleep Lib "kernel32" Alias "Sleep" (ByVal dwMilliseconds As Long)

Sleep 3000 ' = 3 seconds

OR

You can create a For Loop like this:

dim n as long
For i = 1 to n
     Doevents 'Let Windows handles other processes.
Next i


'Hope will help.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 19

Accepted Solution

by:
BrianGEFF719 earned 5 total points
ID: 6162943
LOL, when i read the question there was no comments, i went to the bathroom came back and commented and your comment was there...


0
 
LVL 52

Expert Comment

by:Ryan Chong
ID: 6162947
Correct my codes:

dim n as long

n = 30000

For i = 1 to n
    Doevents 'Let Windows handles other processes.
Next i


0
 

Author Comment

by:vinaikk
ID: 6163238
This is too good thanks a ton !!!
0
 
LVL 4

Expert Comment

by:joachimc
ID: 6163381
Get out of here. Give the points to the right answer.
0
 
LVL 19

Expert Comment

by:BrianGEFF719
ID: 6163865
joahimc, I did not ask for the points...sorry about that...the reason i left that comment saying that i dident know your post was there i when i posted is because i loaded it and then when to the bathroom came back and posted as you can see my post is 2 min after yours...I dont want the points for it but i dont think there is anyway he can take them back and give them to you...but i do agree you deserve them...

Brian
0
 
LVL 4

Expert Comment

by:joachimc
ID: 6163877
Not your fault he should know who to choose by himself shouldn't he :)
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

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…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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…
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…

734 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