private static Guid GetCLSID (Type t)
{
if (t.IsImport)
return t.GUID;
// look at supertypes
Type super = t.BaseType;
while (super != typeof (object)) {
if (super.IsImport)
return super.GUID;
super = super.BaseType;
}
throw new COMException ("Could not find base COM type for type " + t.ToString());
}