Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.

Compiler Warning (level 1) C4997

Error Message

'class': coclass does not implement a COM interface or pseudo-interface

A class marked with the coclass attribute did not implement an interface.

The following sample generates C4997:

// C4997.cpp
// compile with: /WX
// to resolve this C4997, uncomment all code
#include <objbase.h>

[ object ]
__interface I {
   HRESULT func();

[ coclass ]
struct C /*: I*/ {
   HRESULT func() {
      return S_OK;
};   // C4997

Community Additions

© 2015 Microsoft