public bool CanCastTo (Type fromType, object o)
{
__ComObject co = o as __ComObject;
if (co == null)
throw new NotSupportedException ("Only RCWs are currently supported");
if ((fromType.Attributes & TypeAttributes.Import) == 0)
return false;
if (co.GetInterface (fromType, false) == IntPtr.Zero)
return false;
return true;
}
}