Hi Aurel,
Ptr is a reserved word, so changing to aPtr solves the problem
'Get String from Pointer
! lstrlenA Lib "kernel32.dll" (ByVal lpString As Long) As Long
! PutMem4 Lib "msvbvm60.dll" (ByVal Addr As Long, ByVal NewVal As Long) As Long
! SysAllocString Lib "oleaut32.dll" (Optional ByVal pszStrPtr As Long) As Long
! SysAllocStringByteLen Lib "oleaut32.dll"(Optional ByVal pszStrPtr As Long, Optional ByVal Length As Long) As String
! SysReAllocString Lib "oleaut32.dll" (ByVal pBSTR As Long, Optional ByVal pszStrPtr As Long) As Long
declare function GetStrFromPtrA(ByVal aPtr As Long) As String
'test
'Returns a copy of a null-terminated ANSI string (LPSTR/LPCSTR) from the given pointer
Function GetStrFromPtrA(ByVal aPtr As Long) As String
Function = SysAllocStringByteLen( aPtr, lstrlenA(aPtr))
End Function