ID:189226
 
Option Explicit
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

Private Sub Command1_Click()
Command1.Caption = "Hi"
Sleep 1000
Command1.Caption = "Go Away now!"
Sleep 1000
Command1.Caption = "I said leave..."
End Sub


I've got that code, and it works perfectly... at home. Where it doesn't work however, is at school, I'm running windows 98, they're using XP with extremely limited access(IE: no system files). When I try to run that sample project I wrote up, It gives me a run-time error along the lines of no sleep found in kernel32. My theory is that either the limited access is stopping VB from using kernel32, or that windows XP works a bit differently than 98 with that file. Anyone care to comment?
It's because the Windows XP kernal doesn't contain that function, you could write your own sleep function, I had one around here, but I can't seem to find it; and I don't really have time to write one out offhand.
In response to Nadrew
Thanks for confirming my suspicion(I don't recall if I wrote that one down or not but it was one of my thoughts on it). I'll see if I can find one, I'm not too skilled at VB yet(just starting the fourth week of the class). I'm beginning to think the teacher doesn't even know any VB; he gives us assignments with a one week due date, and says we probably won't get done, and half of us are done two or three days early.