नोट
इस पृष्ठ तक पहुंच के लिए प्राधिकरण की आवश्यकता होती है। आप साइन इन करने या निर्देशिकाएँ बदलने का प्रयास कर सकते हैं।
इस पृष्ठ तक पहुंच के लिए प्राधिकरण की आवश्यकता होती है। आप निर्देशिकाएँ बदलने का प्रयास कर सकते हैं।
'static_member_function' : cannot use static function to create an unbound delegate
Remarks
When you call an unbound delegate, you must pass an instance of an object. Since a static member function is called through the class name, you can only instantiate an unbound delegate with an instance member function.
For more information about unbound delegates, see How to: Define and Use Delegates (C++/CLI).
Example
The following example generates C3367.
// C3367.cpp
// compile with: /clr
ref struct R {
void b() {}
static void f() {}
};
delegate void Del(R^);
int main() {
Del ^ a = gcnew Del(&R::b); // OK
Del ^ b = gcnew Del(&R::f); // C3367
}