?
Solved

Sleep the Process

Posted on 2001-06-07
9
Medium Priority
?
1,286 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 53

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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 19

Accepted Solution

by:
BrianGEFF719 earned 20 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 53

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

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

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…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
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…
Suggested Courses
Course of the Month12 days, 7 hours left to enroll

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