Results 1 to 5 of 5

Thread: DLL help..

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jul 2000
    Posts
    17

    Question

    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.

  2. #2
    Fanatic Member
    Join Date
    Mar 2000
    Location
    That posh bit of England known as Buckinghamshire
    Posts
    658
    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!

  3. #3
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649
    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!

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Jul 2000
    Posts
    17
    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.

  5. #5
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649
    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
  •  



Click Here to Expand Forum to Full Width