Getting IShellFolder*

Getting IShellFolder*

Post by Tim Tabo » Mon, 19 Jun 2000 04:00:00



If I have explorer.exe's current IShellBrowser* and IShellView*, is there
any documented way to get the view's IShellFolder*?

Many thanks.

 
 
 

Getting IShellFolder*

Post by Jim Barr » Tue, 20 Jun 2000 04:00:00



> If I have explorer.exe's current IShellBrowser* and IShellView*,
> is there any documented way to get the view's IShellFolder*?

I can't think of a direct way of doing it, but how about this:

1) Get the data object for all the view items by calling
IShellView::GetItemObject with the SVGIO_ALLVIEW flag.

2) If the data object supports the CFSTR_SHELLIDLIST format, get the folder
id-list from the CIDA structure.

3) Bind to the folder by calling IShellFolder::BindToObject on the desktop
folder.

Maybe somebody else has a more reliable method?

Cheers,

- Jim

 
 
 

Getting IShellFolder*

Post by Tim Tabo » Tue, 20 Jun 2000 04:00:00


This was quit clever, Jim.  One more:

The pidl is relative to its parent (which is find for getting the
IShellFolder*).  How can I get the folder's fully-qualified path path?

// timtabor



> > If I have explorer.exe's current IShellBrowser* and IShellView*,
> > is there any documented way to get the view's IShellFolder*?

> I can't think of a direct way of doing it, but how about this:

> 1) Get the data object for all the view items by calling
> IShellView::GetItemObject with the SVGIO_ALLVIEW flag.

> 2) If the data object supports the CFSTR_SHELLIDLIST format, get the
folder
> id-list from the CIDA structure.

> 3) Bind to the folder by calling IShellFolder::BindToObject on the desktop
> folder.

> Maybe somebody else has a more reliable method?

> Cheers,

> - Jim

 
 
 

Getting IShellFolder*

Post by Tim Tabo » Wed, 21 Jun 2000 04:00:00


I spoke too soon, Jim.

I can get the pidl, and it works fine if it's a child of the desktop.  But
if it's further down the food chain,
pShellFolderDesktop->BindToObject(pidlView, ...)
fails with an E_INVALIDARG;



> > If I have explorer.exe's current IShellBrowser* and IShellView*,
> > is there any documented way to get the view's IShellFolder*?

> I can't think of a direct way of doing it, but how about this:

> 1) Get the data object for all the view items by calling
> IShellView::GetItemObject with the SVGIO_ALLVIEW flag.

> 2) If the data object supports the CFSTR_SHELLIDLIST format, get the
folder
> id-list from the CIDA structure.

> 3) Bind to the folder by calling IShellFolder::BindToObject on the desktop
> folder.

> Maybe somebody else has a more reliable method?

> Cheers,

> - Jim

 
 
 

Getting IShellFolder*

Post by Tim Tabo » Wed, 21 Jun 2000 04:00:00


Well, the newsgroup posting is slow, but I've got this working [again].
Thanks again.



> > If I have explorer.exe's current IShellBrowser* and IShellView*,
> > is there any documented way to get the view's IShellFolder*?

> I can't think of a direct way of doing it, but how about this:

> 1) Get the data object for all the view items by calling
> IShellView::GetItemObject with the SVGIO_ALLVIEW flag.

> 2) If the data object supports the CFSTR_SHELLIDLIST format, get the
folder
> id-list from the CIDA structure.

> 3) Bind to the folder by calling IShellFolder::BindToObject on the desktop
> folder.

> Maybe somebody else has a more reliable method?

> Cheers,

> - Jim

 
 
 

Getting IShellFolder*

Post by Jeff Koh » Mon, 31 Jul 2000 04:00:00



Quote:> This was quit clever, Jim.  One more:

> The pidl is relative to its parent (which is find for getting the
> IShellFolder*).  How can I get the folder's fully-qualified path path?

Your other post implies that you figured this out. Care to share the answer?

Thanks,

Jeff

 
 
 

1. Caching IShellFolders for IShellFolder::BindToObject

Hi,
I have implemented a cache for storing IShellFolders that are created by
explorer calling IShellFolder::BindToObject() in my multi level foldering
NSE. Basically I have a hashtable that is keyed on a string representation
of the pidl of the IShellFolder. Each time BingToObject is called I try to
obtain an IShellFolder from the cache by the string representation of the
absolute pidl constructed from the pidl passed into BindToObject. If the
cache does not hold the requested IShellFolder then I create a new one, add
it to the cache and pass it back out of the function. Debugging this things
seem to work fine and IShellFolders are being taken from the cache and given
to explorer however when I try to go into a subfolder in the NSE explorer
does the work to bind to the new IShellFolder but never calls the
IShellFolder::CreateViewObject method, this means the namespace is still
sitting in the same folder view as before.

Anyone got any ideas?

Andy

2. Direct CD - please help

3. IShellFolder::ParseDisplayName unknown

4. Outlook

5. XP IShellFolder::EnumObjects bug

6. Pilot 5000 1MB memory hack?

7. How to register a object(DLL) implemented the IShellFolder interface?

8. IShellFolder marshaling

9. IShellFolder

10. IShellFolder::ParseDisplayName called with strange arguments

11. Win98 and IShellFolder

12. IShellFolder and NT4