Delen via


Compilerfout C3808

'type': een klasse met het kenmerk ComImport kan lid lid 'lid' niet definiƫren, alleen abstracte of dllimport-functies zijn toegestaan

Opmerkingen

Een type dat is afgeleid van ComImportAttribute kan lid niet worden gedefinieerd.

De opties /clr:pure en /clr:safe compiler zijn afgeschaft in Visual Studio 2015 en worden niet ondersteund in Visual Studio 2017.

Example

In het volgende voorbeeld wordt C3808 gegenereerd.

// 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
};