IClassDef::CreateInterfaceDef

Meta Data Services Programming

Meta Data Services Programming

IClassDef::CreateInterfaceDef

The CreateInterfaceDef method creates a new interface definition and adds the interface to the collection of interfaces implemented by the class.

HRESULT CreateInterfaceDef(     VARIANT        sObjId,
    BSTR              Name,
    VARIANT        sIID,
    IInterfaceDef  *pIAncestor,
    BSTR              Flags,
    IInterfaceDef  **ppIInterfaceDef
);

Parts

sIObjId

[in]
The object identifier to be assigned to the new interface definition object. If this parameter is set to OBJID_NULL, the repository engine assigns an object identifier for you.

Name

[in]
The name of the interface you are creating.

sIID

[in]
The global identifier associated with the signature for this interface. If there is none, set this parameter to zero.

*pIAncestor

[in]
The interface pointer to the base interface from which the interface being added is derived.

Flags

[in]
If the interface that you are adding is the default interface for the class, pass in the string "Default". Otherwise, pass in a null string.

*pplInterfaceDef

[out]
The interface pointer for the new interface.

Return Value

S_OK

The method completed successfully.

Error Values

This method failed to complete successfully.

Remarks

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.

See Also

IClassDef Interface

IInterfaceDef Interface