CString strDescription = _T("This is a ds for HOT_IM chat log");
CString strFil = _T("MS Access");
CString strUserCommit = _T("Yes");
::RegSetValueEx(hKey,_T("Description"), 0L,REG_SZ, (CONST BYTE*)((LPCTSTR)strDescription), strDescription.GetLength());
::RegSetValueEx(hKey,_T("FIL"), 0L,REG_SZ, (CONST BYTE*)((LPCTSTR)strFil), strFil.GetLength());
::RegSetValueEx(hKey,_T("UserCommitSync"), 0L,REG_SZ, (CONST BYTE*)((LPCTSTR)strUserCommit), strUserCommit.GetLength());
为什么运行结果在注册表里只显示 This is a ds for
MS A
Y后面的怎么都不显示了 为什么啊?
CString strFil = _T("MS Access");
CString strUserCommit = _T("Yes");
::RegSetValueEx(hKey,_T("Description"), 0L,REG_SZ, (CONST BYTE*)((LPCTSTR)strDescription), strDescription.GetLength());
::RegSetValueEx(hKey,_T("FIL"), 0L,REG_SZ, (CONST BYTE*)((LPCTSTR)strFil), strFil.GetLength());
::RegSetValueEx(hKey,_T("UserCommitSync"), 0L,REG_SZ, (CONST BYTE*)((LPCTSTR)strUserCommit), strUserCommit.GetLength());
为什么运行结果在注册表里只显示 This is a ds for
MS A
Y后面的怎么都不显示了 为什么啊?
(LPBYTE)strDescription
{
// TODO: Add your control notification handler code here
HKEY hKey;
LPBYTE SetContent_S=(LPBYTE)"成功";
::RegOpenKeyEx(HKEY_CURRENT_USER,"Software\\Microsoft",0,KEY_WRITE,&hKey);
::RegSetValueEx(hKey,"例1",NULL,REG_SZ,SetContent_S,CString(SetContent_S).GetLength());
}
strDescription.GetLength() * 2
(strDescription.GetLength() + 1) * 2