zoukankan      html  css  js  c++  java
  • MFC CFileDialog用法例子。

     Set it to TRUE to construct a File Open dialog box. Set it to FALSE to construct a File Save As dialog box.

    void CCompFileDlg::OnDirbrowser()

    {

        // TODO: Add your control notification handler code here

        CFileDialog fileDialog(TRUE);

        if (fileDialog.DoModal() == IDOK) {

            CString pathName = fileDialog.GetPathName();

            int index = pathName.ReverseFind('\');

            if (index == -1) {

                AfxMessageBox(L"The Directory is not correct!");

                return;

            }

            m_DirPathString = pathName.Left(index);

            UpdateData(FALSE);

        }

    }

     

    void CCompFileDlg::OnFilebrowser()

    {

        // TODO: Add your control notification handler code here

        CFileDialog fileDialog(FALSE);

        if (fileDialog.DoModal() == IDOK) {

            m_FilePathString = fileDialog.GetPathName();

            UpdateData(FALSE);

        }

    }

     

  • 相关阅读:
    数字类型内置方法
    流程控制之while循环
    流程控制之if判断
    基本运算符
    格式化输出的三种方式
    Python与用户交互
    解压缩
    布尔值(bool)
    django基础 -- 8.cookie 和 session
    为博客园文章添加目录的方法
  • 原文地址:https://www.cnblogs.com/time-is-life/p/5764605.html
Copyright © 2011-2022 走看看