MFC程序在执行到ProcessShellCommand处,报"Fail to create empty document"。
原因:MainFrm在OnCreate中有如下调用
char file[MAX_PATH];
sprintf(file,"%s\\lib_visual.dat",GetDirPath(PATH_SYS_DIR));
CFile f(file,CFile::modeReadWrite);
f.Read(m_bDispLib,sizeof(m_bDispLib));
f.Close();
调试发现,当lib_visual.dat文件不存在时就会报错,放上lib_visual.dat文件就解决了,是因为当文件不存在的时候仍旧执行f.Read操作导致了错误。