zoukankan      html  css  js  c++  java
  • 如何得到运行程序的路径,以及如何得到路径的文件夹,文件名,以及类型等等信息

    ********************************************************************/
    /* */
    /* Function name : GetAppDir */
    /* Description : Get application directory. */
    /* */
    /********************************************************************/
    void GetAppDir(CString& strAppDir)
    {
    TCHAR szFullPath[MAX_PATH];
    TCHAR szDir[_MAX_DIR];
    TCHAR szDrive[_MAX_DRIVE];

    // Get application's full path.
    ::GetModuleFileName(NULL, szFullPath, MAX_PATH);

    // Break full path into seperate components.
    _splitpath(szFullPath, szDrive, szDir, NULL, NULL);

    // Store application's drive and path
    strAppDir.Format(_T("%s%s"), szDrive, szDir);
    }


  • 相关阅读:
    struts2 DMI
    MFC添加背景图片
    c++ 副本构造器
    climits
    Qt中的qreal
    Http概述(一)
    重构学习-重构原则
    QDir的mkdir和mkpath区别
    Qt学习笔记网络(一)
    Qt5 新特性
  • 原文地址:https://www.cnblogs.com/confach/p/112089.html
Copyright © 2011-2022 走看看