With pb 5.46 (86/64) it works. 5.62 & 5.70b2 it does not.
Any ideas on if there's something I'm doing wrong, or is it a PB issue? (and is there any way around it?)
Code: Select all
;DWORD WINAPI GetFullPathName(
; _In_ LPCTSTR lpFileName,
; _In_ DWORD nBufferLength,
; _Out_ LPTSTR lpBuffer,
; _Out_ LPTSTR *lpFilePart
; );
Procedure.s GetFullPathName( cPath.s )
Protected cFullPath.s, *Buffer, nSize=#MAX_PATH, *FilePart
*Buffer = AllocateMemory(nSize)
If *Buffer
nSize = GetFullPathName_(@cPath,nSize,*Buffer,@*FilePart)
If nSize
cFullPath = PeekS(*Buffer,nSize)
If *FilePart
Debug PeekS(*FilePart)
EndIf
Debug cFullPath
EndIf
FreeMemory(*Buffer)
Else
Debug "Alloc failure"
EndIf
ProcedureReturn cFullPath
EndProcedure
Debug GetFullPathName(GetFilePart(ProgramFilename()))