Jump to content

UUID Interface Blues

Recommended Posts

Can anyone work the UUID Interface? I sure would like to use it to extract the unique name for a networked system...


The [uuid] interface attribute designates a universally unique identifier (UUID) that is assigned to the interface and that distinguishes it from other interfaces.

uuid (string-uuid) 
uuid ("string-uuid")
Specifies a string consisting of 8 hexadecimal digits followed by a hyphen, then three groups of 4 hexadecimal digits each followed by a hyphen, then 12 hexadecimal digits. You can enclose the UUID string in quotes, except when you use the MIDL compiler switch /osf. 
Return Values
This attribute has no return values. 
The run-time library uses the interface UUID that the [uuid] attribute designates to help establish communication between the client and server applications. The [uuid] attribute can appear in the interface attribute list for either an RPC interface or a COM interface.

For an RPC interface, the interface attribute list must include either the [uuid] attribute or the [local] attribute, and the one you choose must occur exactly once. If the list includes the [uuid] attribute, it can also include the [version] attribute.

For a COM interface (identified by the [object] interface attribute), the interface attribute list must include the [uuid] attribute, but it cannot include the [version] attribute. The list for a COM interface can include the [local] attribute even though the [uuid] attribute is present.

Microsoft RPC supports an extension to DCE IDL that allows the UUID to be enclosed in double quotation marks ("" ""). The quoted form is needed for C-compiler preprocessors that interpret UUID numbers as floating-point numbers.

All UUID values should be computer-generated to guarantee uniqueness. Use the uuidgen utility to generate unique UUID values.

The UUID and version numbers of the interface are used to determine whether the client can bind to the server. For the client to bind to the server, the UUID specified in the client and server interfaces must be the same.

Note that an interface without attributes can be imported into a base IDL file. However, the interface must contain only datatypes with no procedures. If even one procedure is contained in the interface, a local or UUID attribute must be specified.

Example Code 
See Also
Interface Definition (IDL) File, interface, local, object, /osf, version
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...