Windows API Functions

L

LesHurley

I have copied the following declaration and an accompaning function call from
Walkenbach"s p\Power Programming With VBA.

Declare Function GetWindowsDirectoyA Lib "Kernel32" _
(ByVal lpBuffer As String, ByVal nSize As Long) As Long

I get the runtime error "Can't find DLL entry point GetWindowsDirectoryA in
kernel32.

I am using WindowsXP home ed. Does anyone know if XP has that function?
 
P

Peter T

You have a typo in GetWindowsDirectoyA , missing an"r" before the "y"

Public Declare Function GetWindowsDirectory _
Lib "kernel32" Alias "GetWindowsDirectoryA" ( _
ByVal lpBuffer As String, _
ByVal nSize As Long) As Long

Although not necessary, to adhere to convention you might copy the API as
written above (line breaks optional)

Regards,
Peter T
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top