I Can Use SHBrowseForFolder function But.
C / C++ / MFC
2
Posts
2
Posters
0
Views
1
Watching
-
Hi . What can I do to use return value. :rose: Thanks a lot.
-
Hi . What can I do to use return value. :rose: Thanks a lot.
SHBrowseForFolder returns a pointer to an ITEMIDLIST. You can use the SHGetPathFromIDList() to retrieve the path of the folder selected. Use an IMalloc interface to free the memory pointed to by the ITEMIDLIST pointer.
TCHAR thePath[_MAX_PATH];
ITEMIDLIST* idl;
idl = SHBrowseForFolder(A_Previously_Initialized_BROWSEINFO);
if (idl)
{
if (SHGetPathFromIDList(idl, thePath))
Do_Something_With(thePath);
LPMALLOC lpMalloc; // pointer to IMalloc
if (SHGetMalloc(&lpMalloc) == NOERROR)
lpMalloc->Free(idl);
}--- Multitasking: Screwing up several things at once.