Getting a memory access error when the api is called...
Invalid Memory Access, read error at address 0
Code: Select all
Prototype.i ptGetLongPathName(*cShort.s, *cLong.s, nBuffLen.l)
Procedure.s GetLongFromShort( cShort.s )
Protected nHnd = OpenLibrary(#PB_Any,"Kernel32.dll")
Protected cLong.s = cShort
If nHnd
Protected GetLongPathName_.ptGetLongPathName = GetFunction(nHnd, "GetLongPathName")
cLong = Space(#MAX_PATH)
Debug " Long: (@"+Hex(@cLong)+") = "+cLong
Debug "Short: (@"+Hex(@cShort)+") = "+cShort
GetLongPathName_(@cShort,@cLong,#MAX_PATH) ; << Invalid Memory Access, read error at address 0
CloseLibrary(nHnd)
EndIf
ProcedureReturn cLong
EndProcedure