Hi Everyone,
I am confused by the declares for GetSystemDirectoryA or GetSystemDirectoryW not available with the System.IsFunctionAvailable command, and yet calling the function will correctly return the System Directory. I have tried many different ways of creating the declare, and am not sure why the IsFunctionAvailable cannot recognize this function. Maybe I have been on the computer too long
Here is the code which shows that both events are not available:
[code]Sub Action() Handles Action
#If TargetWindows
Soft Declare Function GetSystemDirectoryW Lib “Kernel32.dll” (lpBuffer As Ptr, nSize As UInt32) As UInt32
Soft Declare Function GetSystemDirectoryA Lib “Kernel32.dll” (lpBuffer As Ptr, nSize As UInt32) As UInt32
If System.IsFunctionAvailable("GetSystemDirectoryW", "Kernel32.drv") Then
System.DebugLog "GetSystemDirectoryW in Action Event is Available"
Else
System.DebugLog "GetSystemDirectoryW in Action Event is not Available"
End If
If System.IsFunctionAvailable("GetSystemDirectoryA", "Kernel32.drv") Then
System.DebugLog "GetSystemDirectoryA in Action Event is Available"
Else
System.DebugLog "GetSystemDirectoryA in Action Event is not Available"
End If
//Error 126 - The specified module could not be found
#Endif
End Sub
[/code]
How can I have this function available? I could just ignore IsFunctionAvailable, and then this would be a concern on an older Windows OS when the Unicode version is called. Any helpful thoughts? Thanks
Edit: This is on Windows 10, Xojo 2018 r2.