ACF

[ interface-attribute-list ] interface interface-name

   
[ include filename-list ; ... ]
    [ typedef [type-attribute-list] typename; ... ]

    [   [ [function-attribute-list] ] function-name(
                  [ [ [parameter-attribute-list] ] parameter-name ]
                  ...
        );
   
]
    ...
}

interface-attribute-list

Specifies a list of one or more attributes that apply to the interface as a whole. Valid attributes include auto_handle, implicit_handle, explicit_handle, and optimize, code, or nocode. When two or more interface attributes are present, they must be separated by commas.

interface-name

Specifies the name of the interface. In DCE-compatibility mode, the interface name must match the name of the interface specified in the IDL file. When you use the MIDL compiler switch /acf, the interface name in the ACF and the interface name in the IDL file can be different.

filename-list

Specifies a list of one or more C-language header filenames, separated by commas. The full filename, including the extension, must be supplied.

type-attribute-list

Specifies a list of one or more attributes, separated by commas, that apply to the specified type. Valid type attributes include allocate or represent_as.

typename

Specifies a type defined in the IDL file. Type attributes in the ACF can only be applied to types previously defined in the IDL file.

function-attribute-list

Specifies a list of one or more attributes, separated by commas, that apply to the function-return type. Valid function attributes include allocate, optimize, call_as, code or nocode.

function-name

Specifies the name of the function in the IDL file.

parameter-attribute-list

Specifies a list of zero or more attributes, separated by commas, that apply to the specified parameter. Valid parameter attributes include byte_count.

parameter-name

Specifies the name of the parameter in the IDL file. Only the name of the parameter must match the IDL file specification. The sequence of parameters is not significant.

 

Examples

/* example 1 */

[auto_handle] interface foo1 {  } 

 

/* example 2 */

[implicit_handle(handle_t h), code] interface foo2 { }

 

/* example 3 */

[code] 

interface foo3;

    include "foo3a.h", "foo3b.h";

    typedef [allocate(all_nodes)] TREETYPE1;

    typedef [allocate(all_nodes, dont_free)] TREETYPE2;

    f1([byte_count(length)] pBuffer);

}

 

Remarks

The application configuration file, or ACF, is one of two files that define the interface for your distributed application. The second interface-defining file is the IDL file. The IDL file contains type definitions and function prototypes that describe how data is transmitted on the network. The ACF configures your application for a particular operating environment without affecting its network characteristics.

By using the IDL and ACF files, you separate the interface specification from environment-specific settings. The IDL file is meant to be portable to any other computer. When you move your distributed application to another computer, you should be able to reuse the IDL file. Environment-specific changes are made in the ACF.

Many distributed applications require no special configuration. For such applications, use the MIDL compiler switch /app_config2BPQZ9K to supply the ACF keywords auto_handle and implicit_handle in the IDL file and omit the ACF.

The ACF corresponds to the IDL file in the following ways:

    The interface name in the ACF must be the same as the interface name in the IDL file, unless you compile with the MIDL compiler switch /acf.

    All type names and function names in the ACF must refer to types and functions defined in the IDL file.

    Function parameters do not need to appear in the same sequence in the ACF as in the IDL file, but parameter names in the ACF must match names in the IDL file.

 

As with the IDL file, the ACF consists of a header portion and a body portion and, except in /osf mode, can contain multiple interfaces.

See Also

/app_config, auto_handle, code, explicit_handle, IDL, implicit_handle, include, midl, nocode, optimize, represent_as, typedef