Declaring Asynchronous Functions

To declare an RPC function as asynchronous, first declare the function as part of an interface definition, in an IDL file. Then modify that function declaration within the ACF file by applying the async attribute, as shown in the followingexample. Notice that the function declaration makes no mention of the asynchronous handle. Applying the async attribute in the ACF file generates an additional parameter — the asynchronous handle — in the stub code.

Example

//file:Xasync.idl
interface AsyncIface 
{
HRESULT MyAsyncFunc (handle_t hBinding,
[in] int a,
[in] int b,
[out] int *c) ;
//other interface definitions
}
//end XAsync.idl
 
// file: Xasync.acf
interface AsyncIface
{
[async] MyAsyncFunc () ;
//any other ACF definitions
}
//end Xasync.acf