Teilen über


Compilerfehler C3917

'property': veraltete Deklarationsformatvorlage für Konstrukte

Bemerkungen

Eine Eigenschaft oder Ereignisdefinition verwendet syntax aus einer Version vor Visual Studio 2005.

Weitere Informationen finden Sie unter property.

Beispiel

Im folgenden Beispiel wird C3917 generiert:

// C3917.cpp
// compile with: /clr /c
public ref class  C {
private:
   int m_length;
public:
   C() {
      m_length = 0;
   }

   property int get_Length();   // C3917

   // The correct property definition:
   property int Length {
      int get() {
         return m_length;
      }

      void set( int i ) {
         m_length = i;
      }
   }
};