नोट
इस पृष्ठ तक पहुंच के लिए प्राधिकरण की आवश्यकता होती है। आप साइन इन करने या निर्देशिकाएँ बदलने का प्रयास कर सकते हैं।
इस पृष्ठ तक पहुंच के लिए प्राधिकरण की आवश्यकता होती है। आप निर्देशिकाएँ बदलने का प्रयास कर सकते हैं।
'object' : delegate constructor: second argument must be address of a static member function or global function
Remarks
The compiler expected the address of a function declared static.
Example
The following example generates C3351:
// C3351a.cpp
// compile with: /clr
delegate int D(int, int);
ref class C {
public:
int mf(int, int) {
return 1;
}
static int mf2(int, int) {
return 1;
}
};
int main() {
System::Delegate ^pD = gcnew D(nullptr, &C::mf); // C3351
System::Delegate ^pD2 = gcnew D(&C::mf2);
}