error C2664: 'fopen' : cannot convert parameter 1 from 'CString' to 'const char *'
程序:doubleCCameraDemoDlg::FingerVeinMatch(CStringCS_FilehName1,CStringCS_FilehName2,in...
程序:
double CCameraDemoDlg::FingerVeinMatch(CString CS_FilehName1,CString CS_FilehName2, int MatchValue)
{FILE *fin1; fin1 = fopen(CS_FilehName1,"r");
。。。
fclose(fin1);
}
编译错误:
error C2664: 'fopen' : cannot convert parameter 1 from 'CString' to 'const char *'
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
fin1 = fopen((const char *)CS_FilehName1,"r"); 时候出现错误:
1>.\CameraDemoDlg.cpp(1002) : error C2440: 'type cast' : cannot convert from 'CString' to 'const char *'
1> No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
fin1 = fopen(CS_FilehName1.GetBuffer(),"r"); 时候出现错误:
1>.\CameraDemoDlg.cpp(1027) : error C2664: 'fopen' : cannot convert parameter 1 from 'wchar_t *' to 'const char *'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast 展开
double CCameraDemoDlg::FingerVeinMatch(CString CS_FilehName1,CString CS_FilehName2, int MatchValue)
{FILE *fin1; fin1 = fopen(CS_FilehName1,"r");
。。。
fclose(fin1);
}
编译错误:
error C2664: 'fopen' : cannot convert parameter 1 from 'CString' to 'const char *'
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
fin1 = fopen((const char *)CS_FilehName1,"r"); 时候出现错误:
1>.\CameraDemoDlg.cpp(1002) : error C2440: 'type cast' : cannot convert from 'CString' to 'const char *'
1> No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
fin1 = fopen(CS_FilehName1.GetBuffer(),"r"); 时候出现错误:
1>.\CameraDemoDlg.cpp(1027) : error C2664: 'fopen' : cannot convert parameter 1 from 'wchar_t *' to 'const char *'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询