Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Compiler Error C2787
Collapse the table of content
Expand the table of content

Compiler Error C2787

'identifier' : no GUID has been associated with this object

The __uuidof operator takes a user-defined type with a GUID attached or an object of such a user-defined type. This error occurs when the argument is a user-defined type with no GUID.

Example

// C2787.cpp
struct F {
};

struct __declspec(uuid("00000000-0000-0000-0000-000000000000")) F2 {
};

void bar(void)
{
    __uuidof(F);     // C2787
    __uuidof(F *);   // C2787

    __uuidof(F2);    // OK
}
Show:
© 2015 Microsoft