示例#1
0
文件: PathUtils.cpp 项目: 1ldk/mpc-hc
 CString ToRelative(LPCTSTR dir, const LPCTSTR path, bool* pbRelative/* = nullptr*/)
 {
     CPath cp;
     BOOL rel = cp.RelativePathTo(dir, FILE_ATTRIBUTE_DIRECTORY, path, 0);
     if (pbRelative) {
         *pbRelative = !!rel;
     }
     return cp;
 }
示例#2
0
void CPPageWebServer::OnBnClickedButton1()
{
	CString dir = GetCurWebRoot();
	if(PickDir(dir)) {
		CPath path;
		if(path.RelativePathTo(GetMPCDir(), FILE_ATTRIBUTE_DIRECTORY, dir, FILE_ATTRIBUTE_DIRECTORY)) {
			dir = (LPCTSTR)path;
		}
		m_WebRoot = dir;
		UpdateData(FALSE);
	}
}