char buf[]="D:\\2003年04月14日\\09-16-59.doc\0";

SHFILEOPSTRUCT ss;
ss.hwnd = this->m_hWnd;
ss.wFunc = FO_DELETE  ;
ss.fFlags=FOF_NOCONFIRMATION|FOF_NOERRORUI;
ss.hNameMappings=NULL;
ss.lpszProgressTitle="正在删除..."; ss.pFrom= buf; SHFileOperation(&ss); //执行这句话老出错,错误并不是没有元目标路径之内的,而是shell32.dll和内核.dll出错这是为什么?------------------------------------------------------ for (int i=0; i<nItemCount; i++)
{
if ( pCurPage->m_ChannelList.GetCheckbox(i,0) )
{
sFilePath+= pCurPage->m_ChannelList.GetItemText(i, 3);
sFilePath+='\0';
}
}
SHFILEOPSTRUCT ss;
ss.hwnd = this->m_hWnd;
ss.wFunc = FO_DELETE  ;
ss.fFlags=FOF_NOCONFIRMATION|FOF_NOERRORUI;
ss.hNameMappings=NULL;
ss.lpszProgressTitle="正在删除..."; ss.pFrom= sFilePath; SHFileOperation(&ss); //这样删除多个文件也不行,到底为什么

解决方案 »

  1.   

    先把 SHFILEOPSTRUCT 清0 pTo 
    Address of a buffer to contain the name of the destination file or directory. This parameter must be set to NULL if it is not used.SHFILEOPSTRUCT shfo;
    memset(&shfo, 0, sizeof(shfo));shfo.hwnd = this->m_hWnd;
    shfo.wFunc = FO_DELETE  ;
    shfo.fFlags = FOF_NOCONFIRMATION|FOF_NOERRORUI;
    shfo.hNameMappings = NULL;
    shfo.lpszProgressTitle = _T("正在删除...");shfo.pFrom = _T("D:\\2003年04月14日\\09-16-59.doc\0");SHFileOperation(&shfo);
      

  2.   

    怪事情,现在有好了我将责分这代copy到另外一个函数调试可以,然后再删除,回来调试就可以热,我这个人呀
      

  3.   

    怎么是满篇的错字啊============================================================================
    http://www.betajin.com/alphasun/index.htm           给我发信息请附带原帖地址
    http://alphasun.18en.com/                    http://shakingtoolkit.9126.com/
    DocWizard C++程序文档自动生成工具 | Wave OpenGL | HttpProxy | AjaxParser词法分析