|
-
Aug 24th, 2000, 06:44 AM
#1
Thread Starter
Junior Member
I'm calling the "sleep" function in VB script in Access.
I've declared the library as the following:
Declare Sub sleep Lib "kernel32.dll" (ByVal dwMilliseconds As Long)
And then called sleep from a function:
Sleep(1000)
I get a run-time error 453 - Can't find DLL entry point...
I guess it can't find the sleep procedure in kernel32.dll..But where would it be? Any help would be appreciated thanks.
-
Aug 24th, 2000, 06:55 AM
#2
Fanatic Member
Try declaring it like so...
Code:
Public Declare Sub Sleep Lib "kernel32" Alias "Sleep" (ByVal dwMilliseconds As Long)
Iain, thats with an i by the way!
-
Aug 24th, 2000, 06:56 AM
#3
No it exist in the Kernel32 library. The thing is that all API declarations are case sensitive. Make sure you declare it exactly like this:
Code:
Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
That is change sleep into Sleep with a capital S.
Good luck!
-
Aug 24th, 2000, 07:02 AM
#4
Thread Starter
Junior Member
You know what? It's working thanks. Funny thing. I did add the alias at first, but it automatically dissappeared everytime I added it. Now it stayed.
I also tried it with the S, not s. Thanks. i didn't realize it's case sensitive.
-
Aug 24th, 2000, 07:12 AM
#5
VB always automatically takes away the alias if the alias is spelled exactly like the sub or function name. So in this case it would remove it:
Code:
Public Declare Sub Sleep Lib "kernel32" Alias "Sleep" (ByVal dwMilliseconds As Long)
But in this way it would remain:
Code:
Public Declare Sub sleep Lib "kernel32" Alias "Sleep" (ByVal dwMilliseconds As Long)
Again it's because the declaration (on Win32) is case sensitive.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|