PRB: IShellFolder::ParseDisplayName and '..'

PRB: IShellFolder::ParseDisplayName and '..'

Post by umec.. » Wed, 01 Nov 2000 00:23:49



Hello,

I've discovered an inconsistency in this method, regarding the parsing
of paths containing the '..' parent folder specifier. If you try an
absolut path like "C:\winnt\.." then it fails (parsing from desktop). I
know that this path don't makes much sense <g> but why should it fail?
Here's some sample code:

/* path exists on disk */
LPWSTR absPath = L"C:\\winnt\\..";

/* assume pIDeskFolder is valid IShellFolder*
 * obtained earlier, pointing at the namespace root.
 */

LPITEMIDLIST pidl;
DWORD chEaten;
HRESULT hr;

/* this fails, returned pidl==NULL */
hr = pIDeskFolder->ParseDisplayName(NULL, NULL, absPath,
   &chEaten, &pidl, NULL);

ASSERT(hr == 0x80004005); /* "unspecified error" */

Trying a ::SetCurrentDirectory() on this path works ok (but
FIndFirstFile fails, too). Why should there be such a discrepancy? If
this is by design, what's the proper route to parse paths containing
'..'?

Thanks,
Nikos

--
TSEK-IT: http://personal-pages.ps.ic.ac.uk/~umeca74/
2xExplorer R7 just made windows Explorer obsolete

Sent via Deja.com http://www.deja.com/
Before you buy.

 
 
 

1. IShellFolder::ParseDisplayName unknown

Hi!

In the documentation it's explained, how to use IShellFolders. But my code
forces lcc to break compiling with "unknown field 'ParseDisplayName' of
'struct IShellFolder'.

BROWSEINFO bi;
CHAR buffer[1024];

static int SelectDir(void){

    LPITEMIDLIST pidlSelected = NULL;
    BROWSEINFO bi = {0};
    IShellFolder *psfDeskTop = NULL;
    ULONG chEaten;

    SHGetDesktopFolder(&psfDeskTop);
    psfDeskTop->GetDisplayName(NULL, NULL, L"c:\\Windows", &chEaten,
&bi.pidlRoot, NULL);

    bi.hwndOwner=NULL;
    bi.pszDisplayName=buffer;
    bi.lpszTitle="Bitte w?hlen Sie ein Verzeichnis:";
    bi.ulFlags=BIF_RETURNONLYFSDIRS;
    bi.lpfn=NULL;
    bi.lParam=0;
    bi.iImage=0;

    pidlSelected = SHBrowseForFolder(&bi);

    if (!pidlSelected)
        return 0;

    SHGetPathFromIDList(pidlSelected, buffer);

    return 1;

2. Evaluating Expert Systems

3. IShellFolder::ParseDisplayName called with strange arguments

4. Atari Jaguar Emulator.

5. "" "" "" " '' '' '' '' '' '' '' ''

6. Play midi files on an Atari 520 STF

7. PRB: Dimmer won't stop

8. Succession no succes

9. ''''''Astra-1200s 3.1 Firmware available here'''''''

10. STOP THIS 'CY986 vs intel 200086' 'quake' 'overclocking' BULLSHIT

11. operator '~~' for types 'inet' and '"unknown"'

12. DLookup('field', 'table', ['condition'])