version

version ( major-value[minor-value)

major-value
Specifies a short unsigned integer between zero and 65,535, inclusive, that represents the major version number.
minor-value
Specifies a short unsigned integer between zero and 65,535, inclusive, that represents the minor version number. The minor version value is optional. If present, the minor version value is separated from the major version number by a period character (.). If not specified, the minor version value is zero.

Remarks

The version interface attribute identifies a particular version among multiple versions of an RPC interface. With the version attribute, you ensure that only compatible versions of client and server software are allowed to bind.

The MIDL compiler does not support multiple versions of an OLE interface. As a result, an interface attribute list that includes the object attribute cannot include the version attribute. To create a new version of an existing OLE interface, use interface inheritance. A derived OLE interface has a different UUID but inherits the interface member functions, status codes, and interface attributes of the base interface.

In combination with the uuid value, the version value uniquely identifies the interface. The run-time library passes the version and uuid values to the server when the client calls a remote function. A client can bind to a server for a given interface if:

It is to your benefit and your users' benefit to retain upward compatibility among versions — that is, to modify the interface so that only the minor version number changes. You can retain upward compatibility when you add new data types that are not used by existing functions and when you add new functions without changing the interface specification for existing functions.

Change the major version number if any one of the following conditions apply:

Change the minor version number if all of the following conditions apply:

If your modifications qualify as an upward-compatible change to the interface, use the following procedure to modify the interface (IDL) file:

  1. Add new constant and type definitions to the interface file.
  2. Add callback functions to the end of the interface file.
  3. Add new functions to the end of the interface file.

The version attribute can occur at most once in the interface header.

When the version attribute is not present, the interface has a default version of 0.0.

The period character between the major and minor numbers is a delimiter and does not represent a decimal point. The minor number is treated as an integer. Leading zeroes are not significant. Trailing zeroes are significant.

For example, the version setting 1.11 represents a major value of one and a minor value of eleven. Version 1.11 does not represent a value between 1.1 and 1.2.

See Also

IDL, interface, uuid