Hi guys. I keep getting a compile error that makes no sense to me. I am trying to convert a managed delegate to a function pointer. I am using the following msdn tutorial to do so.
http://msdn.microsoft.com/en-us/library/367eeye0(VS.80).aspx
The code I wrote looks like so
in the header
delegate int GetTheAnswerDelegate(int, int);
int GetNumber(int n, int m) {
Console::WriteLine("[managed] callback!");
return n + m;
}
in my constructor I wrote the following
GetTheAnswerDelegate^ fp = gcnew GetTheAnswerDelegate(&CubeTrisApp::FlashController::GetNumber);
The error I keep getting is
Error 1 error C3352: 'int CubeTrisApp::FlashController::GetNumber(int,int)' : the specified function does not match the delegate type 'int (int,int)'
However it looks like my GetNumber function matches my delegate. Any ideas? Thanks!