Link to home
Start Free TrialLog in
Avatar of howardsd
howardsd

asked on

runtime error '453' Can't find DLL entry point GetCurrentDirectory in kernel32

i'm attempting to make a GetCurrentDirectory function call in my form_load routine but get the error stated in the subject

any help would be appreciated!!!

the following is my code



Private Declare Function GetCurrentDirectory Lib "kernel32" ( _
                                  ByVal nBufferLength As Long, _
                                  ByVal lpBuffer As String) As Long

Public strPath as String


Private Sub Form_Load()
Dim lngTemp As Long
 
  strPath = String(255, 0)
 
  lngTemp = GetCurrentDirectory(255, strPath)
 
  MsgBox strPath
End Sub
ASKER CERTIFIED SOLUTION
Avatar of vascov
vascov
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of howardsd
howardsd

ASKER

figured it out! had to declare the function uising an alias of "GetCurrentDirectoryA"

Private Declare Function GetCurrentDirectory Lib "kernel32" Alias "GetCurrentDirectoryA" (ByVal nBufferLength As Long, ByVal lpBuffer As String) As Long

u beat me by 1 minute!

:)

Glad that you found it!