public static string PropGetStr(IntPtr hObject, int idProp)
{
int nChars, i, ch;
char[] Buf;
nChars = Lcad.PropGetStr2(hObject, idProp);
if (nChars > 0)
{
Buf = new char[nChars];
for (i=0; i<nChars; ++i)
{
ch = Lcad.PropGetChar(i);
Buf[i] = Convert.ToChar(ch);
}
return new string(Buf);
}
return "";
}
Used to implement function
Function PropGetStr (ByVal hObject As IntPtr, ByVal idProp As Integer) As String
Dim Buf() As Char
Dim nChars As Integer
Dim ch As Integer
nChars = Lcad.PropGetStr2(hObject, idProp)
If nChars > 0 Then
Buf = New Char(nChars) {}
nChars = nChars - 1
For i As Integer = 0 To nChars
ch = Lcad.PropGetChar(i)
Buf(i) = ChrW(ch)
Next
Return New String(Buf)
End If
Return ""
End Function