The CreateInterfaceDef method creates a new interface definition, and adds the interface to the collection of interfaces that are implemented by the class.
Set variable = object.CreateInterfaceDef(sObjId, name, interfaceId, ancestor, flag)
The CreateInterfaceDef method syntax has the following parts.
| Part | Description |
| variable | A variable declared as an InterfaceDef object. Receives the new interface definition. |
| object | An object expression that evaluates to a ClassDef object |
| sObjId | The object identifier to be assigned to the new interface definition object. If this parameter is set to OBJID_NULL, Microsoft® Repository assigns an object identifier for you. |
| name | The name of the interface that is to be created |
| interfaceId | The interface identifier for this interface. If there is none, set this parameter to zero. |
| ancestor | The InterfaceDef definition object for the interface that is the base interface from which the interface being created is derived. |
| flag | If the interface that you are creating is the default interface for the class, pass in the string "Default". Otherwise, pass in a null string. |
When you indicate that an interface is the default interface for a class, you are actually setting the value of the ImplementsOptions annotational property on the Class_Implements_Interface relationship to TRUE. (Remember that every relationship can have annotational properties set on it.)