Edit

Share via


declare_guid keyword

The declare_guid keyword instructs MIDL to emit a GUID variable into the generated header file.

declare_guid(variable-name, guid)

Parameters

variable-name

Specifies a variable name for the identifier in the generated header file.

guid

Specifies the GUID that will apply to the variable name in the generated header file.

Examples

declare_guid(SID_Widget, 5144C348-169E-4359-A79D-5482461D9929)  

Remarks

Using declare_guid is equivalent to using cpp_quote to generate an invocation of the EXTERN_GUID macro.

The above example results in the following output:

cpp_quote("EXTERN_GUID(SID_Widget, 0x5144c348, 0x169e, 0x4359, 0xa7, 0x9d, 0x54, 0x82, 0x46, 0x1d, 0x99, 0x29);")

The declare_guid statement is provided as a convenience. It has the advantage of using the same GUID syntax as the uuid attribute.

See also

Interface Definition (IDL) File

cpp_quote

uuid attribute

GUID structure