title: Write array to IStream
body: <p>I recieve some data as a char array. I want to pass this data to a method that recieves a stream (IUnknown *pInput). </p>
  
  <p>I tried to debug this piece of code (using visual c++):</p>
  
  <hr>
  
  <pre><code>#include "xmllite.h"
  #include &lt;atlbase.h&gt;
  </code></pre>
  
  <hr>
  
  <pre><code>CHAR acTemp [100] = {0};
  CComPtr&lt;IStream&gt; pDataStream;
  HRESULT hr;
  
  hr = IStream_Write (pDataStream, acTemp, sizeof (acTemp));
  </code></pre>
  
  <p>I get the error:</p>
  
  <p>Unhandled exception at 0x75e49875 in SSL.exe: 0xC0000005: Access violation reading location 0x00000000.</p>
  
  <p>I know that the following code that creates a strem from a file will work, but I didn't want to create a file just because I can't convert from the original array.</p>
  
  <pre><code>CComPtr&lt;IStream&gt; pFileStream;
  LPCSTR szFileName = "FileName";
  HRESULT hr;
  
  hr = SHCreateStreamOnFile(szFileName, STGM_READ, &amp;pFileStream);
  </code></pre>