Export (0) Print
Expand All
Expand Minimize

Compiler Error C2775

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

A data member declared with the property extended attribute does not have a get function specified, but an expression tries to retrieve its value.

Example

// C2775.cpp
struct A {
   __declspec(property(put=PutProp)) int prop;
   int PutProp(void);
};

int f(A* pa)
{
   int x = pa->prop;   // C2775
   return x;
}
Show:
© 2014 Microsoft