interface

[ interface-attribute-list ] interface interface-name [ : base-interface ]

/*IDL file typedef syntax */
typedef interface interface-name declarator-list

interface-attribute-list
Specifies attributes that apply to the interface as a whole. Valid interface attributes for an IDL file include endpoint, local, object, pointer_default, uuid, and version. Valid interface attributes for an ACF include encode, decode, either auto_handle or implicit_handle, and either code or nocode.
interface-name
Specifies the name of the interface. The interface name must be a unique name and must start with an alphabetic or underscore character.
base-interface
Specifies the name of an interface from which this derived interface inherits member functions, status codes, and interface attributes. The derived interface does not inherit type definitions. To do this, use the import keyword to import the IDL file of the base interface.
declarator-list
Specifies standard C declarators, such as identifiers, pointer declarators, and array declarators. For more information, see pointers and arrays. The declarator-list consists of one or more declarators, separated by commas.

Examples

/* use of interface keyword in IDL file for an RPC interface */ 
  [ uuid (00000000-0000-0000-0000-000000000000), 
    version (1.0) ] 
  interface remote_if_2 
  {  
  } 
 
/* use of interface keyword in ACF for an RPC interface */ 
  [ implicit_handle( handle_t xa_bhandle ) ] 
  interface remote_if_2 
  { 
  } 
 
/* use of interface keyword in IDL file for an OLE interface */ 
  [ object, uuid (00000000-0000-0000-0000-000000000000) ] 
  interface IDerivedInterface : IBaseInterface 
  {  
    import "base.idl" 
    Save(); 
  } 
 
/* use of interface keyword to define an interface pointer type */ 
  typedef interface IStorage *LPSTORAGE; 
 

Remarks

The interface keyword specifies the name of the interface. The interface name must be provided in both the IDL file and the ACF.

The interface names in the IDL file and ACF must be the same, except when you use the MIDL compiler switch /acf. For more information, see /acf.

The interface name forms the first part of the name of interface-handle data structures that are parameters to the RPC run-time functions. For more information, see RPC_IF_HANDLE.

If the interface header includes the object attribute to indicate an OLE interface, it must also include the uuid attribute and must specify the base OLE interface from which it is derived. For more information about OLE interfaces, see object.

You can also use the interface keyword with the typedef keyword to define an interface data type.

See Also

ACF, endpoint, IDL, local, pointer_default, uuid, version