Udostępnij przez


Błąd kompilatora C3807

"type" : klasa z atrybutem ComImport nie może pochodzić z "type2", tylko implementacja interfejsu jest dozwolona

Uwagi

Typ pochodzący z ComImportAttribute klasy może implementować tylko interfejs.

Przykład

Poniższy przykład generuje kod 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 {};