I cant see why this isnt working? ive pulled it from one of my VB apps (that could be why) where it was working
Result& returns 8, but the WindowsDirectory string buffer isnt "C:\WINNT" - its blank
can anyone please tell me what im doing wrong? Thankyou!
------------------
Result& returns 8, but the WindowsDirectory string buffer isnt "C:\WINNT" - its blank
can anyone please tell me what im doing wrong? Thankyou!
Code:
#COMPILE EXE DECLARE FUNCTION GetWindowsDirectory LIB "Kernel32.DLL" ALIAS "GetWindowsDirectoryA" (BYVAL lpBuffer AS STRING, BYVAL nSize AS LONG) AS LONG FUNCTION PBMAIN() AS LONG ON ERROR RESUME NEXT iH& = SHELL(COMMAND$, 1) LOCAL WindowsDirectory AS STRING * 144 WindowsDirectory = SPACE$(144) Result& = GetWindowsDirectory(BYVAL WindowsDirectory, 144) MSGBOX LEFT$(WindowsDirectory,Result&),, "Result& = " & STR$(Result&) END FUNCTION
Comment