// 选择目录
char PathName[MAX_PATH];
BROWSEINFO bi;
bi.hwndOwner = NULL;
bi.pidlRoot = NULL;
bi.pszDisplayName = PathName;
bi.lpszTitle = "指定图书数据存放的目录:";
bi.ulFlags = BIF_RETURNONLYFSDIRS;
bi.lpfn = NULL;
LPITEMIDLIST pidl = SHBrowseForFolder(&bi);
if(pidl != NULL)
{
if(SHGetPathFromIDList(pidl,PathName))
{
LPMALLOC pMalloc;
SHGetMalloc( &pMalloc );
pMalloc->Free(pidl);
sDataPath = PathName;
m_reg.WriteString(_T("DataPath"),sDataPath);
}
}
char PathName[MAX_PATH];
BROWSEINFO bi;
bi.hwndOwner = NULL;
bi.pidlRoot = NULL;
bi.pszDisplayName = PathName;
bi.lpszTitle = "指定图书数据存放的目录:";
bi.ulFlags = BIF_RETURNONLYFSDIRS;
bi.lpfn = NULL;
LPITEMIDLIST pidl = SHBrowseForFolder(&bi);
if(pidl != NULL)
{
if(SHGetPathFromIDList(pidl,PathName))
{
LPMALLOC pMalloc;
SHGetMalloc( &pMalloc );
pMalloc->Free(pidl);
sDataPath = PathName;
m_reg.WriteString(_T("DataPath"),sDataPath);
}
}