ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Windows API Functions (https://www.excelbanter.com/excel-programming/407346-windows-api-functions.html)

LesHurley

Windows API Functions
 
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?

--
Thanks for your help

Gary''s Student

Windows API Functions
 
GetWindowsDirectoryA
not
GetWindowsDirectoyA
--
Gary''s Student - gsnu200772

Peter T

Windows API Functions
 
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



"LesHurley" wrote in message
...
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?

--
Thanks for your help




LesHurley

Windows API Functions
 
What a difference a letter mkes. Thanks
--
Thanks for your help


"Peter T" wrote:

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



"LesHurley" wrote in message
...
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?

--
Thanks for your help






All times are GMT +1. The time now is 11:43 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com