Platform SDK Shell >> Bug? Unoptimized Move from NSE to Explorer

by Chad Yoshikawa » Tue, 24 May 2005 23:04:33 GMT

I have a NSE with a view created by SHCreateShellFolderView

When moving (shift-drag in my case) a file 'foo.txt' from the NSE to
explorer, the copy happens correctly, then explorer does something
unexpected: it creates a new top-level ShellFolder of my namespace,
gets the context menu of the pidl associated with 'foo.txt', and
executes the delete verb on this file. This should complete the 'move'
operation.

At first, I was happy to see explorer doing so much work for me. But
Explorer always gets the **top-level** ShellFolder and asks it (via
GetUIObjectOf) for the context menu of the file, regardless of what
level the file is. So if I have a file "/one/two/foo.txt", then
explorer (really, the DefView) will still try to get the context menu
of this file from "/" - the top level folder.

I can work around this by making all of my PIDLs unique to the entire
namespace (rather than just the folder they are in), but this seems
unnecessary and a bug.

Has anyone else run into this?

Thanks,

-Chad Yoshikawa



Platform SDK Shell >> Bug? Unoptimized Move from NSE to Explorer

by Jim Barry » Wed, 25 May 2005 06:36:17 GMT





Interesting... are you saying it doesn't even call your root folder's IShellFolder::BindToObject method?

--
Jim Barry, MVP for Windows SDK



Platform SDK Shell >> Bug? Unoptimized Move from NSE to Explorer

by Chad Yoshikawa » Thu, 26 May 2005 01:11:29 GMT

That's right -- I put a breakpoint in BindToObject and then did the
drag-n-drop move operation and it never got hit.

Something else (must be explorer) is creating the folder, calling
initialize, then directly calling GetUIObjectOf. Here's my ATLTRACE
messages: ((0x01dbcf88) is the instance that is printing the message).
I'm trying to move a file Folder1\P1000693.jpg to a windows folder.
The move happens,then at this point in the trace, the system is trying
to delete the file:

(0x01dbcf88) Ctoring the GalaxyShellFolder
CGalaxyShellFolder(0x01dbcf88)::Initialize() called with pidl <System
PIDL>,<System PIDL>,
GalaxyShellFolder(0x01dbcf88)::GetUIObjectOf P1000693.jpg
CGalaxyShellFolder(0x01dbcf88)::Explorer is asking for a context menu
CContextMenu::QueryContextMenu
CContextMenu::InvokeCommand
CContextMenu: The command string is delete
Delete of the file called
Error - optimized move failed



Bug? Unoptimized Move from NSE to Explorer

by Jim Barry » Fri, 27 May 2005 09:03:53 GMT




I suspect the problem is with the CFSTR_SHELLIDLIST format in your data object. The shell tries to get a context menu object for the items listed in the CIDA structure.

--
Jim Barry, MVP for Windows SDK


Bug? Unoptimized Move from NSE to Explorer

by Chad Yoshikawa » Mon, 30 May 2005 06:38:20 GMT

Thanks for taking the time to diagnose this -- Jim you were 100%
correct.

I accidentally set the CIDA's root pidl to my NSE's root pidl, and not
to the folder's pidl.

-Chad



Bug? Unoptimized Move from NSE to Explorer

by Jim Barry » Tue, 31 May 2005 06:15:05 GMT




You're welcome - glad to hear you've got it working now.

--
Jim Barry, MVP for Windows SDK