Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Create full PIDL from a relative one

131 views
Skip to first unread message

Emil Astrom

unread,
Jan 10, 2001, 4:58:32 AM1/10/01
to
How can I convert a relative PIDL to an absolute one?

I need this since SHGetFileInfo() wants absolute PIDLs and
I need that function to retrieve the icons for the contents
of shell folders.

To enumerate the contents of the folder I use
IShellFolder::EnumObjects() and then IEnumIDList::Next(),
which returns a relative PIDL.

Any ideas?

/Emil

--
===========================================================
Emil Astrom, programmer at Excosoft AB
emil....@excosoft.se http://www.excosoft.se
===========================================================


Sent via Deja.com
http://www.deja.com/

Rob Pitt

unread,
Jan 10, 2001, 5:47:32 AM1/10/01
to
Concatenate them. Search MSDN for "Working with Item ID Lists"

Rob

"Emil Astrom" <emil....@excosoft.se> wrote in message
news:93hbo6$cqq$1...@nnrp1.deja.com...

ume...@my-deja.com

unread,
Jan 10, 2001, 10:54:23 AM1/10/01
to
In article <93hbo6$cqq$1...@nnrp1.deja.com>,

Emil Astrom <emil....@excosoft.se> wrote:
>
> How can I convert a relative PIDL to an absolute one?

PIDLs may sound confusing, but down deep they are like text paths. So if
you have the full PIDL of the container folder (I assume this is the
case since you've got the IShellFolder*), you just need to "append" the
local file PIDL to that and you'll have the global pidl for the file

You'll need to read in the docs about the SHITEMID that is the
elementary unit of all pidls, so as to know how to "walk" a complex pidl
containing more than one "folders" (SHITEMIDs) --- if you don't know
that already that is <g>

Just as C-strings have a null to mark the end, pidls have a null
SHITEMID, which is basically one that has cb==0. You'll have to remove
this "null" from the folder's global pidl, and append verbatim the local
folder's pidl, including its "null".

An altogether different approach would be to use the desktop's
IShellFolder::ParseDisplayName() passing the full UNICODE path of your
file. That should be easier if you don't feel comfortable with SHITEMIDs


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

Emil Astrom

unread,
Jan 11, 2001, 3:41:50 AM1/11/01
to
In article <t5ofdmq...@corp.supernews.com>,

"Rob Pitt" <Rob...@REMOVEME.cyberdude.com> wrote:
> Concatenate them. Search MSDN for "Working with Item ID Lists"

Great! Thank you!

0 new messages