diff --git a/src/os2/stattext.cpp b/src/os2/stattext.cpp index dc70b334f5..1ee58a4b8c 100644 --- a/src/os2/stattext.cpp +++ b/src/os2/stattext.cpp @@ -283,10 +283,6 @@ void wxStaticText::DoSetLabel(const wxString& str) wxString wxStaticText::DoGetLabel() const { - HWND hwnd = GetHwnd(); - LONG textLen = ::WinQueryWindowTextLength(hwnd); - wxCharBuffer buffer(textLen+1); - ::WinQueryWindowText(hwnd, textLen+1, buffer.data()); - return buffer; + return wxGetWindowText(GetHwnd()); }