Ask Learn
Preview
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign inThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Microsoft and C++ Specific —>
**__declspec( uuid(“ComObjectGUID”) )**declarator
The compiler attaches a GUID to a class or structure declared or defined (full COM object definitions only) with the uuid attribute. The uuid attribute takes a string as its argument. This string names a GUID in normal registry format with or without the { } delimiters. For example:
struct __declspec(uuid("00000000-0000-0000-c000-000000000046")) IUnknown;
struct __declspec(uuid("{00020400-0000-0000-c000-000000000046}")) IDispatch;
This attribute can be applied in a redeclaration. This allows the system headers to supply the definitions of interfaces such as IUnknown, and the redeclaration in some other header (such as COMDEF.H) to supply the GUID.
The keyword __uuidof can be applied to retrieve the constant GUID attached to a user defined type.
END Microsoft and C++ Specific
See Also __declspec
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign in