This documentation is archived and is not being maintained.

Compiler Error C2774

'identifier' : no 'put' method is associated with this property

A data member declared with property has no put function, but an expression tries to set its value.

The following sample generates C2774:

// C2774.cpp
struct A {
   __declspec(property(get=GetProp)) int prop;
   int GetProp(void);

   __declspec(property(get=GetProp2, put=PutProp2)) int prop2;
   int GetProp2(void);
   void PutProp2(int);

int main() {
   A* pa = new A;
   int val = 0;
   pa->prop = val;   // C2774
   pa->prop++;   // C2774