Compartir a través de


Error del compilador C3807

"type": una clase con el atributo ComImport no puede derivar de "type2"; solo se permite la implementación de interfaz

Un tipo que deriva de ComImportAttribute solo puede implementar una interfaz.

Ejemplo

El ejemplo siguiente genera el error C3807.

// C3807.cpp
// compile with: /clr /c
ref struct S {};
interface struct I {};

[System::Runtime::InteropServices::ComImportAttribute()]
ref struct S1 : S {};   // C3807
ref struct S2 : I {};