interface attribute

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

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

typedef interface interface-name declarator-list

Parameters

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 Array and Sized-Pointer Attributes, arrays., and Arrays and Pointers. The declarator-list consists of one or more declarators, separated by commas.

Remarks

The interface names in the IDL file and ACF must be the same, except when you use the MIDL compiler switch /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 a COM interface, it must also include the [uuid] attribute and must specify the base COM interface from which it is derived. For more information about COM interfaces, see [object].

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

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 
{  
    // Interface definition statements.
} 
 
/* use of interface keyword in ACF for an RPC interface */ 
[
    implicit_handle( handle_t xa_bhandle ) 
] 
interface remote_if_2 
{ 
    // Attribute configuration statements.
} 
 
/* use of interface keyword in IDL file for a COM 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;

See also

Application Configuration File (ACF)

endpoint

Interface Definition (IDL) File

local

object

pointer_default

RPC_IF_HANDLE

typedef

uuid

version