Compiler Error C3734
Visual Studio 2015
The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.
The latest version of this topic can be found at Compiler Error C3734.
class': a managed or WinRT class cannot be a coclass
The coclass attribute cannot be used with managed or WinRT classes.
The following sample generates C3734 and shows how to fix it:
// C3734.cpp
// compile with: /clr /c
[module(name="x")];
[coclass]
ref class CMyClass { // C3734 remove the ref keyword to resolve
};
The following sample generates C3734 and shows how to fix it:
// C3734_b.cpp
// compile with: /clr:oldSyntax /c
[module(name="x")];
[coclass]
__gc class CMyClass { // C3734 remove the __gc keyword to resolve
};
Show: