Can you spot the mistake in this code? Here we implement a CCW-based .NET object. This COM class is exposed as from a certain process (say, a service) to other processes in the system. We implement a simple get/set accessor that receives an array of objects:

[ComVisible(true), GuidAttribute("61b5d373-4258-40a2-89ac-2783d8ac0e99")]
class MyComObject
{
   public object[]  Filter
   {
      get { return objArray; }

      set
      {
         Debug.Trace("SET: new array received: '{0}'" + objArray.Length);
         objArray = value;
      }
   }

   private object[] objArray = new object[0];

}

This COM object can be potentially called from another process B, for example from a VB script. For example, something like this:

Dim formatsArray(2)
formatsArray(1) = "abc"
formatsArray(2) = "def"

Set myObject = CreateObject( "TEST.MyComObject" )
myObject.Filter = formatsArray