title: how to pass a byte array from a CSharp client application to an ATL COM object
body: <p>I want to write an application with csharp which reads the content of a file and passes it to an ATL COM object.</p>
  
  <p>I have a problem with IDL. I defined a method named "Decode" on an ATL-COM object like below:</p>
  
  <pre><code>[id(101), helpstring("Decode")] HRESULT Decode([in] BYTE* pBuff, [in] INT nLen, [out, retval] INT* pnRetVal);
  </code></pre>
  
  <p>But, when I compiled my own COM dll and wanted to use it in the CSharp application I found the method with this signature:</p>
  
  <pre><code>int MyClass.Decode(ref byte pBuff, int nLen);
  </code></pre>
  
  <p>But, I excepted to have a method like this:</p>
  
  <pre><code>    int MyClass.Decode(byte[] pBuff, int nLen);
  </code></pre>
  
  <p>Do you have any suggestions? I also tried different types such as VARIANT* or BYTE**, but I look for best solution.</p>