title: Using, StringCchCat
body: <p>I'm trying to use the <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms647518(v=vs.85).aspx" rel="nofollow">StringCchCat</a> function:</p>
  
  <pre><code>    HRESULT X;
      LPWSTR _strOutput =  new wchar_t[100];
      LPCWSTR Y =L"Sample Text";
      X = StringCchCat(_strOutput, 100, Y);
  </code></pre>
  
  <p>But for some reason I keep getting the <strong><em>"E_INVALIDARG One or more arguments are invalid."</em></strong> error from X. _strOutput Is also full of some random characters.</p>
  
  <p>This is actually part of a bigger program. So what I'm trying to do is to concatenated the "sample text" to the empty _strOutput variable. This is inside a loop so it is going to happen multiple times. For this particular example it will be as if I'm assigning the Text "Sample Text" to _strrOutput.</p>
  
  <p>Any Ideas?</p>