SHFILEOPSTRUCT的有关问题!!
CString strtime1,strtime="";;
CTime Time = CTime::GetCurrentTime();
strtime1.Format("%4d%s%d%s%d%s%d%s%02d%s%02d%s",Time.GetYear(),"年",Time.GetMonth(),"月",Time.GetDay(),"日",Time.GetHour(),"时",Time.GetMinute(),"分",Time.GetSecond(),"秒");
strtime="c:\\11\\22\\"+strtime1+".dt";
int size = sizeof(strtime);
char FromBuff[sizeof(strtime)+1];
memcpy(FromBuff, strtime, size);
FromBuff[size] = 0x0;
LPTSTR FromBuf = (LPTSTR)(LPCTSTR)strtime;
SHFILEOPSTRUCT lpsh;
ZeroMemory(&lpsh,sizeof(lpsh));
lpsh.hwnd= HWND_DESKTOP;
lpsh.fFlags=FOF_NOCONFIRMATION|FOF_SIMPLEPROGRESS ;
lpsh.wFunc=FO_DELETE;
lpsh.pFrom= FromBuf;
if( 0 != SHFileOperation(&lpsh))
{
AfxMessageBox("删除文件出错,请检查");
return ;
}
请问这段程序为什么会出错?