Sdílet prostřednictvím


Chyba kompilátoru C3808

'type' : třída s atributem ComImport nemůže definovat člen 'member', jsou povoleny pouze abstraktní funkce nebo dllimport.

Poznámky

Typ odvozený z ComImportAttribute nemůže definovat člen.

Možnosti kompilátoru /clr:pure a /clr:safe jsou v sadě Visual Studio 2015 zastaralé a v sadě Visual Studio 2017 nejsou podporované.

Příklad

Následující příklad vygeneruje C3808.

// C3808.cpp
// compile with: /c /clr:pure user32.lib
using namespace System::Runtime::InteropServices;

[System::Runtime::InteropServices::ComImportAttribute()]
ref struct S1 {
   int f() {}   // C3808
   virtual int g() abstract;   // OK

   [DllImport("msvcrt.dll")]
   int printf(System::String ^, int i);   // OK
};