private object QueryInterface(string name)
{
Guid iid = Guid.Empty;
object o = null;
if (COMUtilities.IsValidGUID(name))
{
iid = new Guid(name);
}
else
{
foreach (COMInterfaceEntry ent in GetInterfaces())
{
if (String.Equals(ent.Name, name, StringComparison.OrdinalIgnoreCase))
{
iid = ent.Iid;
break;
}
}
}
Type type = COMUtilities.GetInterfaceType(iid);
if (type != null)
{
o = new DynamicComObjectWrapper(_registry, type, _target);
}
return o;
}