Compiler Error C2778

improperly formed GUID in __declspec(uuid())

An incorrect GUID is supplied to the uuid extended attribute. The supplied GUID must be a string of hexadecimal numbers with the following format:

// Correct:
struct __declspec(uuid("00000000-0000-0000-0000-000000000000")) A { };
struct __declspec(uuid("{00000000-0000-0000-0000-000000000000}")) B { };

The example below generates this error:

// error C2778:
struct __declspec(uuid(" 00000000-0000-0000-0000-000000000000 ")) C { };
struct __declspec(uuid("00000000000000000000000000000000")) D { };

Strings recognized by the CLSIDFromString function, with or without the “{“ and “}” delimiters, are acceptable to the uuid extended attribute.