title: Using MCI to play avi stream from memory
body: <p>I'm trying to play a compressed AVI file using MCI in C#. So far I was able to play it by opening the file.</p>
  
  <p>The way I opened the file is this:</p>
  
  <pre><code>String opencommand = "open \"" + file + "\" type mpegvideo alias someMovie shareable";    
  int error;    
  error = Avi.mciSendString(opencommand, null, 0, IntPtr.Zero);
  </code></pre>
  
  <p>Where <code>file</code> is the file path. The video plays fine this way.</p>
  
  <p>It would be much better in my case if I were able to play it from a stream that is already loaded using <a href="http://msdn.microsoft.com/en-us/library/ms706420(VS.85).aspx" rel="nofollow noreferrer"><code>AVIFileOpen()</code></a> and <code>AVIFileGetStream()</code> from avifil32.dll. From the MSDN documentation it seems like I should be able to do this. They say so <a href="http://msdn.microsoft.com/en-us/library/ms712776(VS.85).aspx" rel="nofollow noreferrer">here</a>:</p>
  
  <blockquote>
    <p>"MCI can open AVI files by using a
    file-interface pointer or a
    stream-interface pointer. To open a
    file by using either type of interface
    pointer, specify an at sign (@)
    followed by the interface pointer in
    place of the file or device name for
    the <code>lpszDevice</code> parameter. For more
    information about the file and stream
    interfaces, see "AVIFile Functions and
    Macros .""</p>
  </blockquote>
  
  <p>But unfortunately they don't go into detail and I have no idea what I'm supposed to do. What does "stream-interface pointer" actually mean and where do I get one from? Because MSDN surely doesn't try to explain the terms they invent.</p>