I wrote a simple application to enumerate all the subfolders and files under
a certain folder. I included all the relevant headers and libs (i.e
shlobj.h, shell32.h/lib, and shlwapi.h/lib). I'm using a Win 2000 Server.
Most of the Shell functions seem to work, but the compiler doesn't seem to
find SHBindToParent or SHGetFolderLocation functions, both of which are
defined in the shlobj.h header (the one on the Win2K at least, not NT 4.0).
I'm using the shell code in an MFC program.
here's a snippet of the function, of course, it doesn't work as advertised
LPMALLOC pMalloc = NULL;
IShellFolder *psfParent = NULL;
LPITEMIDLIST pidlSystem = NULL;
LPCITEMIDLIST pidlRelative = NULL;
hr = SHGetMalloc(&pMalloc);
hr = SHGetFolderLocation(NULL, CSIDL_SYSTEM, NULL, NULL, &pidlSystem);
hr = SHBindToParent(pidlSystem, IID_IShellFolder, (void **) &psfParent,
hr = psfParent->GetDisplayNameOf(pidlRelative, SHGDN_NORMAL,
hr = StrRetToBuf(&strDispName, pidlSystem, szDisplayName,
file://cout << "SHGDN_NORMAL - " <<szDisplayName << '\n';
Any help is highly appreciated.Quote:}