Kompilatorfel C3808

"type" : en klass med attributet ComImport kan inte definiera medlemmens "medlem", endast abstrakta funktioner eller dllimportfunktioner tillåts

Anmärkningar

En typ som härleds från ComImportAttribute kan inte definiera medlem.

Alternativen /clr:pure och /clr:safe compiler är inaktuella i Visual Studio 2015 och stöds inte i Visual Studio 2017.

Example

I följande exempel genereras 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
};