title: How can I obtain the content of a Edit Control with WTL?
body: <p>I've already read up on a few threads here on how to achieve that. I tried several answers but none worked so far. I simply want to get the content of a Edit control, given as CEdit in WTL, and save it into a preferably std::wstring, but I guess I can't get around using CString/TCHAR*.</p>
  
  <p>Prerequisites:</p>
  
  <pre><code>ID of my control: IDC_LINKPASTEEDIT
  
  Member variable IDC_LINKPASTEEDIT is assigned to via DDX MAP: m_linkPasteEdit
  </code></pre>
  
  <p>What I tried so far:</p>
  
  <p>1.)</p>
  
  <pre><code>CString windowText;
  GetDlgItemText(IDC_LINKPASTEEDIT, windowText, 1024);
  </code></pre>
  
  <p>-> Argument list error for GetDlgItemTextA (which is referred to by GetDlgItemText's DEFINE)</p>
  
  <p>2.)</p>
  
  <pre><code>CString windowText;
  m_linkPasteEdit.GetWindowText(windowText);
  </code></pre>
  
  <p>-> Another argument list error for GetDlgItemTextA</p>
  
  <p>I can't quite figure out the correct list as well, as documentation is not existent and looking into the define I feel like my arguments should be correct.</p>
  
  <p>Sadly I didn't find another resource, I even downloaded some html document WTL library, but it seems like CEdit isn't completely documented in there.</p>
  
  <p>Any ideas?</p>
  
  <p>EDIT:</p>
  
  <p>Made it work in a very very weird fashion, which is not really WTL-like in my opinion, but it works at least.</p>
  
  <p>1)  -  Change Multibyte charset to UNICODE in project settings</p>
  
  <p>2)  -   </p>
  
  <pre><code>WCHAR windowText[1024]; 
  GetDlgItemText(IDC_LINKPASTEEDIT, windowText, 1024);
  </code></pre>
  
  <p>Works with multibyte as well by using CHAR instead of WCHAR, but I prefer the wide way.</p>