The ACF File

The ACF file allows you to customize your client and/or server applications' RPC interface without affecting the network characteristics of the interface. For example, if your client application contains a complex data structure that only has meaning on the local machine, you can specify in the ACF file how the data in that structure can be represented in a machine-independent form for remote procedure calls.

Our example demonstrates another use of the ACF file — to specify the type of binding handle that represents the connection between client and server. The implicit_handle attribute in the ACF header allows the client application to select a server for its remote procedure call. We have defined the handle to be of the type handle_t (a MIDL primitive data type). The binding handle name that we specified, hello_IfHandle, will be defined in the MIDL-generated header file. This handle will be used in calls to the client run-time library function.

Notice that this particular ACF file has an empty body.

//file: hello.acf
[implicit_handle (handle_t hello_IfHandle)
] interface hello
{
}
 

The MIDL compiler has an option, /app_config, that lets you include certain ACF attributes, such as implicit_handle, in the IDL file, rather than creating a separate ACF file. Consider using this option if your application doesn't require a lot of special configuration, and if strict OSF compatibility is not an issue.