Skip to content

Latest commit

 

History

History
34 lines (28 loc) · 800 Bytes

compiler-error-c2774.md

File metadata and controls

34 lines (28 loc) · 800 Bytes
description title ms.date f1_keywords helpviewer_keywords ms.assetid
Learn more about: Compiler Error C2774
Compiler Error C2774
11/04/2016
C2774
C2774
10f428c6-7f49-489a-92ba-6ef978b7caaf

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
}