• 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);

        }

    }

     

  • 相关阅读:
    django的用户认证模块(auth)
    算法
    图书管理系统
    mac系统中pycharm激活
    mac常见问题
    mysql安装
    restful规范及DRF基础
    MySQL存储引擎
    [python] with statement
    MySQL索引及执行计划
  • 原文地址:https://www.cnblogs.com/time-is-life/p/5764605.html
Copyright © 2020-2023  润新知