Visual C++ Compiler Error C3360

Message Text

'string': cannot create name

Circumstances

Broadly speaking, this error occurs when an unsuitable UUID is given as the async_uuid argument to the async_uuid attribute or as the uuid argument to one of the attributes module, provider or uuid. The product documentation, evidently not even trying for completeness, cites only the last (uuid).

For the async_uuid and uuid attributes, the argument’s only unsuitability is to be invalid as a GUID string. The string and name placeholders reproduce respectively the argument’s value and name (the latter happening also to be the name of the attribute). For example,

[
    async_uuid (rubbish)
]
__interface Test
{                               // C3360
};

and

[
    uuid (rubbish)
]
class Test;                     // C3360

produce

TEST.CPP(5) : error C3360: 'rubbish': cannot create async_uuid

and

TEST.CPP(4) : error C3360: 'rubbish': cannot create uuid

respectively.

For module, the name placeholder is necessarily “libid”. However, a uuid argument that is invalid as a GUID string does not ordinarily cause error C3360, but is instead caught earlier in response to an argument_type specification in the formal definition of the module attribute, and is rejected as error C3134. It seems that error C3360 can occur only when the argument is left empty. For example,

[
    module (dll, test, 1.0,,)
];                              // C3360

produces

TEST.CPP(3) : error C3360: 'null': cannot create libid

For the provider attribute, what is given as the uuid argument, whether valid or not as a GUID, is not plausibly the CLSID of an attribute provider. The uuid argument is not reproduced in the error message. Instead, the string placeholder reproduces the provider attribute’s name argument, and the name placeholder is IAttributeHandler else IAttributeGrammar, these being COM interfaces that must both be supported by every attribute provider, but which are not found in whatever DLL, if any, is selected by the uuid. For example,

[
    provider (test, rubbish)
];                              // C3360 and C1903

produces

TEST.CPP(3) : error C3360: 'test': cannot create IAttributeHandler

When caused by the provider attribute, error C3360 is unrecoverable and is followed immediately by fatal error C1903.