title: How do you instantiate an IDispatchEx in C#?
body: <p>this is my first SO question!
  I would like to instantiate a COM object and cast it to IDispatchEx so that I can enumerate its members. Here is an example:</p>
  
  <pre>
      Type _COMType = System.Type.GetTypeFromProgID("Scripting.FileSystemObject");
      var _COMObject = (IDispatchEx)Activator.CreateInstance(_COMType);
  </pre>
  
  <p>My IDispatchEx is identical to the one <a href="http://www.koders.com/csharp/fid620085F6ECBCC8F7C598BC99A9B97BB756514DFE.aspx?s=zoom#L1136" rel="nofollow">on this website</a> (not my website), except that GetNextDispID and GetMemberName return an int (which I wish to use for HRESULT as described <a href="http://msdn.microsoft.com/en-us/library/tt99ahf2%28v=vs.85%29.aspx" rel="nofollow">on MSDN</a>).</p>
  
  <p>The example above does not work. Is there any way to instantiate COM objects as you would from Active Scripting cast to the IDispatchEx interface?</p>
  
  <p>Thanks for any and all help/suggestions!</p>