上代码例子
void CAES_GCM_CTRDlg::OnBnClickedButtonEnc()
{
char ch[100];
BYTE KeyArry[50];
CString TempStr;
int tempLen = 0;
m_key.GetWindowText(TempStr);
TempStr.Replace(" ","");
tempLen = TempStr.GetLength();
if (tempLen > 96)
{
if (MessageBox(_T("确定退出吗"), _T("提示"),MB_YESNO|MB_ICONWARNING) == IDNO)
return;
}
memcpy(ch, TempStr.GetBuffer(0), TempStr.GetLength());
}
其中TempStr.Replace(" “,”");编译出现下面错误:
Error 3 error C2664: ‘int ATL::CStringT<BaseType,StringTraits>::Replace(wchar_t,wchar_t)’ : cannot convert parameter 1 from ‘const char [2]’ to ‘wchar_t’ g:\COS Project\Google Smart Tap\AES_GCM\AES-GCM-CTR\AES_GCM_CTR\AES_GCM_CTR\AES_GCM_CTRDlg.cpp 130 AES_GCM_CTR
解决方法: 右键工程属性=>Configuration Properties=>General=>Character Set=>选择Not Set,然后应用确定,编译就可以了。
原配置: 正确配置图:
|