Error del compilador C3807

Actualización: noviembre 2007

Mensaje de error

'tipo' : una clase con el atributo ComImport no puede derivar de 'tipo2', solamente se permite la implementación de interfaz
'type' : a class with the ComImport attribute cannot derive from 'type2', only interface implementation is allowed

Un tipo derivado de ComImportAttribute sólo 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 {};