[ATL] CWindow: Add an overload of GetDlgItemText which takes a CSimpleString as parameter
authorGiannis Adamopoulos <gadamopoulos@reactos.org>
Wed, 6 Dec 2017 17:24:20 +0000 (19:24 +0200)
committerGiannis Adamopoulos <gadamopoulos@reactos.org>
Wed, 27 Dec 2017 17:25:58 +0000 (19:25 +0200)
sdk/lib/atl/atlwin.h

index fa5301f..b210870 100644 (file)
@@ -575,6 +575,17 @@ public:
         return ::GetDlgItemText(m_hWnd, nID, lpStr, nMaxCount);
     }
 
+#ifdef __ATLSTR_H__
+    UINT GetDlgItemText(int nID, CSimpleString& string)
+    {
+        HWND item = GetDlgItem(nID);
+        int len = ::GetWindowTextLength(item);
+        len = GetDlgItemText(nID, string.GetBuffer(len+1), len+1);
+        string.ReleaseBuffer(len);
+        return len;
+    }
+#endif
+
     BOOL GetDlgItemText(int nID, BSTR& bstrText) const
     {
         ATLASSERT(::IsWindow(m_hWnd));