Exactly. To avoid misleadings, the correct W2String() VO-SDK declaration should be "AS PTR", instead of "AS PSZ".Chris wrote: Instead of a PSZ, W2String() actually expects a pointer to a memory location containing a unicode string.
Chris wrote: So, if I am not mistaken, this simpler function should also work fine:
Code: Select all
FUNCTION W2String(p AS PTR) AS STRING
LOCAL IMPLIED cRet := System.Text.StringBuilder{}
LOCAL nIndex AS INT
LOCAL pChar AS WORD PTR
nIndex := 1
pChar := (WORD PTR)p
DO WHILE pChar[nIndex] != 0
cRet:Append(Convert.ToChar(pChar[nIndex]))
pChar ++
END DO
RETURN cRet:ToString()
i think you mean:
DO WHILE pChar[nIndex] != 0
cRet:Append(Convert.ToChar(pChar[nIndex]))
nIndex ++
// pChar ++
END DO
or this one:
DO WHILE pChar[1] != 0
cRet:Append(Convert.ToChar(pChar[1]))
pChar ++
END DO
BTW. The size of the new download icon is impressiv
regards
Karl-Heinz