Expand Minimize
This topic has not yet been rated - Rate this topic

Compiler Error C3734

Error Message

'class': a managed class cannot be a coclass

The coclass attribute cannot be used with managed classes.

The following sample generates C3734:

// 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:

// C3734_b.cpp
// compile with: /clr:oldSyntax /c
[module(name="x")];

[coclass]
__gc class CMyClass {   // C3734 remove the __gc keyword to resolve
};
Did you find this helpful?
(1500 characters remaining)

Community Additions

ADD
© 2013 Microsoft. All rights reserved.