title: Converting Int to LPCWSTR
body: <p>I Have a function in which i get the display resolution. I came up with an idea but the result is just some squares.</p>
  <pre><code>LPCWSTR GetDispRes(HWND hWnd)
  {
      HMONITOR monitor = MonitorFromWindow(hWnd, MONITOR_DEFAULTTONEAREST);
      MONITORINFO info;
      info.cbSize = sizeof(MONITORINFO);
      GetMonitorInfo(monitor, &amp;info);
      int arr[2];
      arr[0] = info.rcMonitor.right - info.rcMonitor.left;
      arr[1] = info.rcMonitor.bottom - info.rcMonitor.top;
      LPCWSTR a;
      std::wstring s = std::to_wstring(arr[0]);
      std::wstring d = std::to_wstring(arr[1]);
  
      std::wstring ress = s + d;
      a = (LPCWSTR)ress.c_str();
  
      return a;
  }
  </code></pre>
  <p>and i'm calling this function from a MessageBox</p>
  <pre><code>MessageBox(NULL, GetDispRes(hWnd) , TEXT(&quot;TEST&quot;), NULL);
  </code></pre>
  <p><strong>and here is the output:</strong></p>
  <p><a href="https://i.stack.imgur.com/14CEz.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/14CEz.png" alt="" /></a></p>
  
  <p>My Question is, what's causing this output? What are the other ways to accomplish that? (converting int to LPWCSTR)? Thanks.</p>