Original Post
Greetings! I have the following code: which results in the following error: D:\Program Files\testdrv\testdrv.cpp(35) : error C2664: 'call' : cannot convert parameter 1 from 'void (void *)' to 'void (__cdecl *)(void *)' I've tried multiple options like type-casting, /GD and /GR compiler options (enable and disable etc), but am quite frustrated as I cannot get to resolve the problem. Any clue what the error is? Thanks.. Taha.
// testdrv.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <fstream>
#include <iostream>
using namespace std;
typedef void (*FPTR)(void*);
class A
{
public:
void doSomething(void* data)
{
}
};
class X
{
public:
void call(FPTR func)
{
func(NULL);
}
};
int main(int argc, char* argv[])
{
X x;
A a;
x.call( a.doSomething );
return 0;
}