windows代码,路径分割

windows代码,路径分割
强烈推介IDEA2021.1.3破解激活,IntelliJ IDEA 注册码,2021.1.3IDEA 激活码  

大家好,我是架构君,一个会写代码吟诗的架构师。今天说一说windows代码,路径分割,希望能够帮助大家进步!!!


BOOL SplitPathName(
    PWSTR MyXbpathBuffer,
    wstring& wdrive,
    wstring& wdir,
    wstring& wfname,
    wstring& wext)//分割路径PWSTR MyXbpathBuffer
{
    TCHAR drive[_MAX_DRIVE];
    TCHAR dir[_MAX_DIR];
    TCHAR fname[_MAX_FNAME];
    TCHAR ext[_MAX_EXT];
    errno_t err;
    err = _wsplitpath_s(
        MyXbpathBuffer,
        drive,
        _MAX_DRIVE,
        dir,
        _MAX_DIR,
        fname,
        _MAX_FNAME,
        ext,
        _MAX_EXT);
    if (err != 0)
    {
        OutputDebugString(TEXT("IsFileSameName _wsplitpath_s Fail"));
        return FALSE;
    }
    wdrive = drive;
    wdir = dir;
    wfname = fname;
    wext = ext;
    return TRUE;
}

转载于:https://www.cnblogs.com/iBinary/p/10749750.html

本文来源weixin_30595035,由架构君转载发布,观点不代表Java架构师必看的立场,转载请标明来源出处:https://javajgs.com/archives/29880

发表评论