title: Why does dynamic method invoke fail when reflection still works?
body: <p>Why can't a <code>dynamic</code> object invoke these methods on the NameTranslate COM object when reflection can?</p>
  
  <p><strong>Failing example using dynamic:</strong></p>
  
  <pre><code>Type ntt = Type.GetTypeFromProgID("NameTranslate");
  dynamic nto = Activator.CreateInstance(ntt);
  nto.Init(3,null)
  </code></pre>
  
  <p>The third line fails with a NotImplementedException and the message <em>The method or operation is not implemented.</em></p>
  
  <p><strong>A similar attempt that works using a different COM object (<a href="http://msdn.microsoft.com/en-us/library/aew9yb99%28v=vs.84%29.aspx">WScript.Shell</a> and <a href="http://msdn.microsoft.com/en-us/library/8c6yea83%28v=vs.84%29.aspx">SendKeys</a>):</strong></p>
  
  <pre><code>Type shellType = Type.GetTypeFromProgID("WScript.Shell");
  dynamic shell = Activator.CreateInstance(shellType);
  shell.SendKeys("abc");
  </code></pre>
  
  <p>Getting back to the first sample. If I use reflection and invoke the methods using the <a href="http://msdn.microsoft.com/en-us/library/66btctbe%28v=vs.110%29.aspx">InvokeMethod</a> method things work fine. </p>
  
  <p><strong>Working example using reflection:</strong></p>
  
  <pre><code>Type ntt = Type.GetTypeFromProgID("NameTranslate");
  object nto = Activator.CreateInstance(ntt);
  object[] initParams = new object[]{3,null};
  ntt.InvokeMember("Init", BindingFlags.InvokeMethod, null, nto, initParams);
  </code></pre>
  
  <p>I believe this must have something to do with how the COM object is created or marked - but for the life of me I can't see anything in the docs, object browser or registry that indicates these COM objects and their subs/functions are marked private or something else that would normally throw off the <code>dynamic</code> keyword.</p>
  
  <p>NameTranslate documentation on MSDN: <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/aa706046.aspx">http://msdn.microsoft.com/en-us/library/windows/desktop/aa706046.aspx</a></p>