void (*pOnCallback)(int, int); void SetCallback(void* pCallbackFunc) { pOnCallback = (void(__cdecl *)(int, int))pCallbackFunc; } int main() { SetCallback(OnCallback); pOnCallback(1,2); } void OnCallback(int data1, int data2) { //... }