Click here to Skip to main content
15,918,168 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
I am trying to implement "copy to"/"copy from" functionality in an application. The idea is that certain files will be copied to (or from) an Android device (usually a Samsung S3, Note II or Tab 2.0, but not necessarily) under program control.

I have "copy from" the device working, as I can select the source folder on the device using CFolderDialog, and happily get IStream* for each of the contained files.

However, I've hit a bit of a brick wall with "copy to". I can specify an existing destination easily enough, and can get IShellItem* for the destination, and navigate up or down from there. Unfortunately the one thing I can't seem to do is to actually create a new target file.

Normally, IFileOperation would be the way to go, but it seems to rely on ITransferDestination (and possibly ITransferSource) being available, which for the Android devices, they aren't.

Has anyone experience of doing this kind of thing? The shell interfaces seem to be a bit of a black art, and asking on MSDN didn't yield anything helpful.

I suspect that if I could only get something like IStorage* on the destination, I could cope, but pShellItem->BindToHandler(NULL, BHID_Storage, IID_IStorage, &pIStorage) gives me E_NOINTERFACE as well. Do I need some magic settings in the IBindCtx object?

It must be possible to do this, since Explorer will let me drag/drop as I want, but I need it to be under program control.

Any clues/hints gratefully received!

Steve S

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900