The composition factory %1 for type %2 in file %3 contains an invalid member function %4. A composition factory must return ...

The composition factory %1 for type %2 in file %3 contains an invalid member function %4.  A composition factory must return an object whose type matches the class being activated and whose last two parameters are an "in" parameter of type Object and a a single "out" parameter whose type is Object. %0