这是VC++的一个工程
bool CWA::findNumber(char *dtmf_num)
{
typedef struct {
char * phoneNumber ;
char * functionName;
void(*action)();
}tNUMBER;
tNUMBER phoneNumbers={"3210","Busy Tone",Dialout};
return(true);
}
void CWA::Dialout()
{
}这时编译不通过,错误是 error C2440: 'initializing' : cannot convert from '' to 'void (__cdecl *)(void)'
None of the functions with this name in scope match the target type
我想可能是C,C++的函数不匹配的问题,比如 Dialout在c中的名字就是Dialout 但到了C++中可能是前面加了很多参数,所以找不到,可能是用extern "c"解决,但我不知加在哪里,请高手指点。
bool CWA::findNumber(char *dtmf_num)
{
typedef struct {
char * phoneNumber ;
char * functionName;
void(*action)();
}tNUMBER;
tNUMBER phoneNumbers={"3210","Busy Tone",Dialout};
return(true);
}
void CWA::Dialout()
{
}这时编译不通过,错误是 error C2440: 'initializing' : cannot convert from '' to 'void (__cdecl *)(void)'
None of the functions with this name in scope match the target type
我想可能是C,C++的函数不匹配的问题,比如 Dialout在c中的名字就是Dialout 但到了C++中可能是前面加了很多参数,所以找不到,可能是用extern "c"解决,但我不知加在哪里,请高手指点。
解决方案 »
- 用VC开发生成SWF格式文件 急急急
- 微软网站直接拿过来的代码(WMI)也有内存访问冲突?
- 求<<com技术内幕>>的配书光盘
- 利用这里的人气问个非开发的问题----怎么恢复刚刚彻底删除的文件?
- 为什么不能运行?!
- vs7的 DDX_Text(pDX, IDC_EDIT1, m_data); 无法进行数据交换??
- win2k,winxp下启动服务的问题(CreateService,OpenService,StartService)?
- 各位谈谈自己的程序生活!
- 兼容模式下获取真实操作系统信息
- 任何理解这段文字的含义!该任何做那?
- 希望论坛增加这样的功能 - 收集(2000留言就说明,论坛应该改进)!希望置顶2 个月
- 关于窗口
class CWA
{
static void Dialout();
}
方法二:定义成全局函数
void Dialout();
typedef struct {
char * phoneNumber ;
char * functionName;
void(CWA::*action)();
}tNUMBER;