CString CMedPlantDoc::GetFilePath(CString description)
{
CString sFolderPath;
BROWSEINFO bi;
char Buffer[MAX_PATH];
CString path;
//³õʼ»¯Èë¿Ú²ÎÊýbi¿ªÊ¼
bi.hwndOwner = NULL;
bi.pidlRoot = NULL;
bi.pszDisplayName = Buffer;//´Ë²ÎÊýÈçΪNULLÔò²»ÄÜÏÔʾ¶Ô»°¿ò
bi.lpszTitle = description;
bi.ulFlags = 0;
bi.lpfn = NULL;
bi.iImage=NULL;
//³õʼ»¯Èë¿Ú²ÎÊýbi½áÊø
LPITEMIDLIST pIDList = SHBrowseForFolder(&bi);//µ÷ÓÃÏÔʾѡÔñ¶Ô»°¿ò
if(pIDList)
{
SHGetPathFromIDList(pIDList, Buffer);
//È¡µÃÎļþ¼Ð·¾¶µ½BufferÀï
sFolderPath = Buffer;//½«Â·¾¶±£´æÔÚÒ»¸öCString¶ÔÏóÀï
}
LPMALLOC lpMalloc;
if(FAILED(SHGetMalloc(&lpMalloc))) return path;
//ÊÍ·ÅÄÚ´æ
lpMalloc->Free(pIDList);
lpMalloc->Release();
path=Buffer;
return path;
}