title: Calling .NET methods from VB6 via COM visible DLL
body: <p>I have created a .NET DLL which makes some methods COM visible.</p>
  
  <p>One method is problematic. It looks like this:</p>
  
  <pre><code>bool Foo(byte[] a, ref byte[] b, string c, ref string d)
  </code></pre>
  
  <p>VB6 gives a compile error when I attempt to call the method:</p>
  
  <blockquote>
    <p>Function or interface marked as
    restricted, or the function uses an
    Automation type not supported in
    Visual Basic.</p>
  </blockquote>
  
  <p>I read that array parameters must be passed by reference, so I altered the first parameter in the signature:</p>
  
  <pre><code>bool Foo(ref byte[] a, ref byte[] b, string c, ref string d)
  </code></pre>
  
  <p>VB6 still gives the same compile error.</p>
  
  <p>How might I alter the signature to be compatible with VB6?</p>