I have installed PB v5.50 x64 & x86, both exits with 1 when used
Code: Select all
MakeSureDirectoryPathExists_("C:\New Folder\")
My OS Win 10 Pro x64 1607 14393.447
Code: Select all
MakeSureDirectoryPathExists_("C:\New Folder\")
https://msdn.microsoft.com/en-us/librar ... s.85).aspxThis function does not support Unicode strings. To specify a Unicode path, use the SHCreateDirectoryEx function.
Code: Select all
Debug SHCreateDirectory_(0, "C:\Temp\Kcc")
Code: Select all
Debug MakeSureDirectoryPathExists_(Ascii("C:\test123\"))
That is a memory leak. You have to manually free the buffer, as per the documentation:infratec wrote:Code: Select all
Debug MakeSureDirectoryPathExists_(Ascii("C:\test123\"))
Creates an Ascii representation of the string. When no more needed, the buffer needs to be freed with FreeMemory().
Code: Select all
Define *Ascii
*Ascii = Ascii("C:\test123\")
If *Ascii
MakeSureDirectoryPathExists_(*Ascii)
FreeMemory(*Ascii)
EndIf
Code: Select all
Procedure.i MakeSureDirectoryPathExists(Path$)
Protected Result.i, *Ascii
*Ascii = Ascii("C:\test123\")
If *Ascii
Result = MakeSureDirectoryPathExists_(*Ascii)
FreeMemory(*Ascii)
EndIf
ProcedureReturn Result
EndProcedure
Code: Select all
Prototype proto_msdpe(Path.p-Ascii)
Procedure _MSDPE(Path.s)
ProcedureReturn MakeSureDirectoryPathExists_(Path)
EndProcedure
Global MakeSureDirectoryPathExists.proto_msdpe = @_MSDPE()
Debug MakeSureDirectoryPathExists("E:\d\c\b\a\")