• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
张纯睿
博客园    首页    新随笔    联系   管理    订阅  订阅

文件默认路径保存批处理

文件默认路径保存批处理

BOOL CLeadShowMultiDocTemplate::SaveAllModified(void)
{
 POSITION pos = GetFirstDocPosition();
 while (pos != NULL)
 {
  CDocument* pDoc = GetNextDoc(pos);
  // --------------------     old       --------------------------
  // The default implementation of this function displays a message box asking the user whether to save the changes to the document,
  // if any have been made. Override this function if your program requires a different prompting procedure. This is an advanced overridable.
  //
  //if (!pDoc->SaveModified())
  // return FALSE;
  // --------------------     new       --------------------------
  // for save all moidied do not need displays a message box asking the user whether to save the changes to the document,
  {
   if (!pDoc->IsModified())
    continue;        // ok to continue

   // get name/title of document
   // c by zcl for Doc path not scf file path,is LED Name, scf file path is changed to save in CScreen 成员变量
   CString PathName = pDoc->GetPathName();
   if (PathName.IsEmpty())
   {
    // get name based on caption
    PathName = GetDocDefaultPath(pDoc, theApp.GetProjectPath());
   }


   //if (!DoFileSave())
   pDoc->SetPathName(PathName);
   if (!pDoc->DoSave(PathName))
    return FALSE;       // don't continue
  }

 }
 return TRUE;
}

posted @ 2010-12-29 09:50  张纯睿  阅读(132)  评论(0)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3