RSS
Follow Us
Contribute
 
 
 
 

Error C3352: (function) : the specified function does not match the delegate type (type)

 
We need YOUR SKILLS in this collaborative work, to build the largest solution center for error messages.

From $1

Table of contents
  1. 1. Cause
  2. 2. Solution
  3. 3. About This Article

Cause

The parameter lists for function and the delegate do not match. Ex:

// compile with: /clr
delegate int D( int, int );
ref class C {
public:
   int mf( int ) {
      return 1;
   }

};

int main() {
   C^ pC = gcnew C;
   System::Delegate^ pD = gcnew D( pC, &C::mf );   // C3352
}

Solution

Possible resolution:

// compile with: /clr
delegate int D( int, int );
ref class C {
public:
   int mf( int ) {
      return 1;
   }

   int mf(int, int) { return 1; }
};

int main() {
   C^ pC = gcnew C;
   System::Delegate^ pD = gcnew D( pC, &C::mf );  
}    

About This Article

This article is a derivative work based on Compiler Error C3352 which is provided by MSDN Community Content - Visual C++.

 
 
 
 
Comments