The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.
We recommend using Visual Studio 2017

Compiler Error C3121


The latest version of this topic can be found at Compiler Error C3121.

cannot change GUID for class 'class_name'

You attempted to change the class ID with __declspec(uuid).

For example, the following code generates C3121:

// C3121.cpp  
[coclass, uuid="00000000-0000-0000-0000-111111111111"]  
class __declspec(uuid("00000000-0000-0000-0000-111111111112")) A   // C3121  
int main()