请帮忙看下以下的代码 问题在哪?? (我的目的是学习回调函数)
我写了个基于对话框的程序
内容如下
自己定义的头文件
typedef int (_stdcall *FUNC)();
typedef int (_stdcall *FUNC2)(int nVal,FUNC pFun);
在对话框的头文件中申明一个函数
int _stdcall CCallexeDlg::GiveYouAInt()
{
int i;
printf("%d",i);
return i;
}
void CCallexeDlg::OnButton1()
{
// TODO: Add your control notification handler code here
HRESULT hr ;
HINSTANCE hinstDll;
hinstDll = LoadLibrary("callback.dll");
FUNC2 fun;
file://fun = (FUNC2)GetProcAddress(hinstDll,"f");
int j=fun(2,GiveYouAInt);///这句编译不过去
error C2664: 'int (int,int (__stdcall *)(void))' : cannot convert parameter 2 from '' to 'int (__stdcall *)(void)'
}
请问是怎么呢?