Click here to Skip to main content
16,016,570 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Directories in CTree View Pin
Nish Nishant23-May-02 1:00
sitebuilderNish Nishant23-May-02 1:00 
GeneralRe: Directories in CTree View Pin
Sameer Maggon23-May-02 1:04
Sameer Maggon23-May-02 1:04 
GeneralRe: Directories in CTree View Pin
Nish Nishant23-May-02 1:13
sitebuilderNish Nishant23-May-02 1:13 
GeneralRe: Directories in CTree View Pin
Prem Kumar23-May-02 1:17
Prem Kumar23-May-02 1:17 
GeneralRe: Directories in CTree View Pin
Sameer Maggon23-May-02 1:22
Sameer Maggon23-May-02 1:22 
GeneralRe: Directories in CTree View Pin
Alexandru Savescu23-May-02 1:30
Alexandru Savescu23-May-02 1:30 
GeneralRe: Directories in CTree View Pin
Nish Nishant23-May-02 1:24
sitebuilderNish Nishant23-May-02 1:24 
GeneralRe: Directories in CTree View Pin
Prem Kumar23-May-02 1:39
Prem Kumar23-May-02 1:39 
Use the foll. code
CString GetUserDirectory()
{
	CString strPath ;
	char szDisplayName[_MAX_PATH] ;
	char *szPath = NULL ;
	char *szTitle = _T(" Please Locate Directory : ") ;//Title of Locate Dialog
	
	BROWSEINFO bi = {0} ; //Init to NULL,so we do not have to fill up some members explicitly to NULL
	
	bi.pszDisplayName	= &szDisplayName[0] ;
	bi.lpszTitle		= szTitle ;
	bi.ulFlags		= BIF_RETURNONLYFSDIRS | BIF_RETURNFSANCESTORS ;
	bi.hwndOwner		= NULL ;
	
	LPITEMIDLIST pidl = SHBrowseForFolder(&bi) ;
	if( pidl == NULL ) //User has cancelled operation
		return strPath ;
	
	//Error Check 
	if( !SHGetPathFromIDList(pidl,szPath) )
	{
		AfxMessageBox(" The Path is Invalid ! ") ;
		return strPath ;
	}
	//Release the PIDL thru Shells MAlloc
	IMalloc *pMalloc = NULL ;
	HRESULT hr =  SHGetMalloc(&pMalloc) ;
	if( !SUCCEEDED(hr) )
		return strPath ;
	
	pMalloc->Free( (void*)pidl ) ;//Release the PIDL
	pMalloc->Release() ;//Release the Interface 

	strPath = szPath ;//The Path to the Directory
	return strPath ;
} 
<pre>

GeneralRe: Directories in CTree View Pin
Sameer Maggon23-May-02 2:08
Sameer Maggon23-May-02 2:08 
GeneralRe: Directories in CTree View Pin
Sameer Maggon23-May-02 2:09
Sameer Maggon23-May-02 2:09 
GeneralRe: Solved Pin
Sameer Maggon23-May-02 2:03
Sameer Maggon23-May-02 2:03 
GeneralRe: Directories in CTree View Pin
Ravi Bhavnani23-May-02 3:31
professionalRavi Bhavnani23-May-02 3:31 
GeneralActiveX Please Help Pin
Sameer Maggon23-May-02 0:10
Sameer Maggon23-May-02 0:10 
GeneralCEdit box Pin
Ruca22-May-02 23:52
Ruca22-May-02 23:52 
GeneralRe: CEdit box Pin
Nish Nishant23-May-02 0:04
sitebuilderNish Nishant23-May-02 0:04 
GeneralRe: CEdit box Pin
Ruca23-May-02 0:03
Ruca23-May-02 0:03 
GeneralRe: CEdit box Pin
Prem Kumar23-May-02 0:07
Prem Kumar23-May-02 0:07 
GeneralRe: CEdit box Pin
Ruca23-May-02 0:09
Ruca23-May-02 0:09 
GeneralRe: CEdit box Pin
Martin Speiser23-May-02 0:31
Martin Speiser23-May-02 0:31 
GeneralRe: CEdit box Pin
Nish Nishant23-May-02 0:30
sitebuilderNish Nishant23-May-02 0:30 
GeneralRe: CEdit box Pin
Roger Allen23-May-02 2:46
Roger Allen23-May-02 2:46 
GeneralSockets object transportation Pin
22-May-02 23:34
suss22-May-02 23:34 
GeneralRe: Sockets object transportation Pin
Nish Nishant23-May-02 0:00
sitebuilderNish Nishant23-May-02 0:00 
GeneralRe: Sockets object transportation Pin
Bene23-May-02 3:19
Bene23-May-02 3:19 
GeneralRe: Sockets object transportation Pin
23-May-02 3:48
suss23-May-02 3:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.