[求助]利用RAS拨号 回调函数类型不正确
if (ERROR_SUCCESS == RasDial(
NULL,
NULL,
&rp,
0L,
// NULL, //为NULL时一切正常,能拨号成功
(RASDIALFUNC)RasDialFunc, // 加入这样的回调函数,编译不正常
&hConn))
其中RasDialFunc声明为
void WINAPI RasDialFunc(
UINT unMsg, // type of event that has occurred
RASCONNSTATE rasconnstate, // connection state about to be entered
DWORD dwError // error that may have occurred
);
定义如下:
void WINAPI RasDialFunc(UINT unMsg, RASCONNSTATE rasconnstate, DWORD dwError)
{
//此处填写代码
}
编译时出错,提示如下:
提示:: error C2440: 'type cast' : cannot convert from '' to 'void (__stdcall *)(unsigned int,enum tagRASCONNSTATE,unsigned long)'
None of the functions with this name in scope match the target type
搞了半天了,都不行,网上也都是这样就能成功的,我的就不成功,请各位高手指正.