הערה
הגישה לדף זה מחייבת הרשאה. באפשרותך לנסות להיכנס או לשנות מדריכי כתובות.
הגישה לדף זה מחייבת הרשאה. באפשרותך לנסות לשנות מדריכי כתובות.
can't take address of 'function' unless creating delegate instance
Remarks
The address of a function was taken in a context other than the creation of a delegate instance.
Example
The following example generates C3374:
// C3374.cpp
// compile with: /clr
public delegate void MyDel(int i);
ref class A {
public:
void func1(int i) {
System::Console::WriteLine("in func1 {0}", i);
}
};
int main() {
&A::func1; // C3374
// OK
A ^ a = gcnew A;
MyDel ^ StaticDelInst = gcnew MyDel(a, &A::func1);
}