Megosztás a következőn keresztül:


C3808 fordítóhiba

"típus": a ComImport attribútummal rendelkező osztály nem definiálhatja a tag "tagját", csak absztrakt vagy dllimport függvények engedélyezettek

Megjegyzések

Egy típus, amely a ComImportAttribute ered, nem definiálhat tagot.

A /clr:pure és /clr:safe fordítóbeállítások elavultak a Visual Studio 2015-ben, és nem támogatottak a Visual Studio 2017-ben.

Example

Az alábbi példa C3808-at hoz létre.

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