Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
'property_accessor': must specify number parameter(s)
Remarks
Check the number of parameters in your get and set methods against property dimensions.
The number of parameters for the
getmethod must equal the number of dimensions of the property or be zero for nonindexed properties.The number of parameters of the
setmethod must be one more than the number of dimensions of the property.
For more information, see property.
Examples
The following example generates C3904.
// C3904.cpp
// compile with: /clr /c
ref class X {
property int P {
// set
void set(); // C3904
// try the following line instead
// void set(int);
// get
int get(int, int); // C3904
// try the following line instead
// int get();
};
};
The following example generates C3904.
// C3904b.cpp
// compile with: /clr /c
ref struct X {
property int Q[double, double, float, float, void*, int] {
// set
void set(double, void*); // C3904
// try the following line instead
// void set(double, double, float, float, void*, int, int);
// get
int get(); // C3904
// try the following line instead
// int get(double, double, float, float, void*, int);
}
};