Export (0) Print
Expand All
COM
id
in
int
odl
out
ptr
ref
Expand Minimize

code attribute

The [code] ACF attribute causes client stub code to be generated for remote functions.


[
    code [ , ACF-interface-attributes ] 
] 
interface interface-name
{
  [ include filename-list ; ]
  [ typedef [type-attribute-list] typenam; ]
  [ [code [ , ACF-function-attributes ]] function-name (
            [ ACF-parameter-attributes ] parameter-name,
        ...);
  ]
    ...
}

Parameters

ACF-interface-attributes

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

interface-name

Specifies the name of the interface.

filename-list

Specifies a list of one or more C-header file names, separated by commas. You must supply the full file name, including the extension.

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] and [represent_as].

typename

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

ACF-function-attributes

Specifies zero or more attributes that apply to the function as a whole, such as [comm_status]. Function attributes are enclosed in square brackets. Separate multiple function attributes with commas.

function-name

Specifies the name of the function as defined in the IDL file.

ACF-parameter-attributes

Specifies ACF attributes that apply to a parameter. Note that zero, one, or more attributes can be applied to the parameter. Separate multiple parameter attributes with commas. ACF parameter attributes are enclosed in square brackets.

parameter-name

Specifies a parameter of the function as defined in the IDL file. Each parameter for the function must be specified in the same sequence and with the same name as defined in the IDL file.

Remarks

The [code] attribute can appear in the ACF header or be applied to an individual function.

When the [code] attribute appears in the ACF header, client stub code is generated for all remote functions that do not have the [nocode] function attribute. You can override the [code] attribute in the header for an individual function by specifying the [nocode] attribute as a function attribute.

When the [code] attribute appears in the remote function's attribute list, client stub code is generated for the function. Client stub code is not generated when:

  • The ACF header includes the [nocode] attribute.
  • The [nocode] attribute is applied to the function.
  • The [local] attribute applies to the function in the interface file.

Either [code] or [nocode] can appear in the interface or function attribute list, but the one you choose can appear only once in the list.

See also

Application Configuration File (ACF)
allocate
auto_handle
comm_status
implicit_handle
local
nocode
optimize
represent_as

 

 

Community Additions

ADD
Show:
© 2014 Microsoft