Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

kernel32.dll in VB 3 and making a program wait inside a subroutine

Status
Not open for further replies.

krackers

Technical User
Oct 23, 2002
2
AU
Haveing trouble in loading kernel32 in vb 3 when I do I get an error saying:

"Error in loading DLL"

This also happens when using advapi32.dll. Do 32bit DLL work with vb3?

also

I am trying to make my vb 3 program to wait 500 milliseconds during a subroutine, I was planning on using the "sleep" function in kernel 32. Is there another way of doing this in vb3?

Note: I can't use a timer because I need to keep the program flow in the subroutine and the need to keep the local variables.

Thanks,
krackers
 
for the first part, you cant use 32 bit with vb3, you have to use the 16 bit version.
for the second part, try this...

Sub Pause(Seconds)
Dim PauseTime, Start
PauseTime = Seconds ' Set duration.
Start = Timer ' Set start time.
Do While Timer < Start + Seconds
DoEvents ' Yield to other processes.
Loop
Finish = Timer ' Set end time.
End Sub
to use it for 500 milliseconds it would be pause(.5)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top