title: Marshalling error when using a C++ library from a C# application
body: <p>I am trying to use a C++ DLL in C# and having some issues between the two with a specific function.</p>
  
  <p>In C++ the function is defined as:</p>
  
  <pre><code>byte* GetEntityUserData(TEntity entity)
  </code></pre>
  
  <p>In C# I've defined it as:</p>
  
  <pre><code>[DllImport(EngineDll)]
  public static extern object[] GetEntityUserData(TEntity entity);
  </code></pre>
  
  <p>When I try to do the following usage:</p>
  
  <pre><code>object[] o = LE.GetEntityUserData(entity);
  </code></pre>
  
  <p>I get the following error:</p>
  
  <blockquote>
    <p>Cannot marshal 'return value': Invalid managed/unmanaged type combination.</p>
  </blockquote>
  
  <p>The C# program compiles, but it gives the run-time error.</p>