lcPropGetStr2 Home

Retrieves a value of text property into inner buffer. Use function lcPropGetChar to get characters from the buffer.

 int lcPropGetStr2 (
   HANDLE hObject,
   int idProp  );

Parameters
hObject
  Handle to object.
idProp
  Property's identifier.

Return Value

  A number of characters copied to the destination buffer, not including the terminating null character.

Remarks

  Used to implement function PropGetStr in the file Litecad.cs
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 PropGetStr in the file Litecad.vb
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

See Also

  Access Objects Properties