0

I've used SHGetDesktopFolder() to get a PIDL and then walked down it's contents using IShellFolder.

I now have a particular PIDL referencing a filesystem location, and I can use BindToStorage and IStorage to .OpenStream() and .Write() a file.

This is all well and good if the interesting things live on the filesystem, but more interesting things live in "Shell Namespace Extensions".

In particular, I have a Pocket PC 2002 device (Specificly, a Symbol PDT8146) that is hooked up to my Windows 7 machine using Windows Mobile Device Center. This application creates a shell namespace folder that I can use from within explorer to read/write files to it.

What I cannot do is write files to it using the command line or win32 APIs.

Following the strategy I outlined above, I can get a PIDL and IShellFolder instance referring to the device, and I can list it's files. However, IShellFolder.BindToStorage() fails with 'No such interface supported' when I try to access IStorage.

Is there another shell interface I should investigate to read/write files on this stubborn device?

EB.
  • 3,383
  • 5
  • 31
  • 43

1 Answers1

0

Try IShellFolder.BindToObject:

IStream *stream;
if (FAILED(shellfolder->BindToObject (pidl, NULL, IID_IStream, &stream)))
  return E_FAIL;

But I'm not sure if this works with writing files as well.

ssbssa
  • 1,261
  • 1
  • 13
  • 21
  • I haven't been able to test that yet, but even if it did work for existing file i/o, how would I go about writing a new file onto the device? – EB. Jun 14 '13 at 15:31
  • I'm not sure about that either, I never needed write access. – ssbssa Jun 14 '13 at 15:49