Solved

MTP (Media transfer protocol) in Delphi

Posted on 2014-03-19
13
471 Views
Last Modified: 2014-11-23
For more information see this question

All is working fine, except I now find one thing is missing - I need to be able to  create folders on the device.

So I need to the code that would do this, or preferably just update the demo project to include an example (via another button)
mtp10.zip
0
Comment
Question by:Clyde24
  • 6
  • 5
13 Comments
 
LVL 26

Expert Comment

by:Sinisa Vuk
ID: 39940824
So... added create folder functionality and fix some stuff.
this is done as recursive function (again) - so you can add full path with few sub-folders which doesn't exists at all.

It is very similar to copy file to specific folder on device....
mtp11.zip
0
 

Author Comment

by:Clyde24
ID: 39941062
Unfortunately the new code in V11 won't compile for me (V10 is still OK).

error1
error2error2.png
0
 
LVL 26

Expert Comment

by:Sinisa Vuk
ID: 39941111
And if you declare function like
function TForm12.GetDeviceId: WideString;
...

Open in new window

?
0
 

Author Comment

by:Clyde24
ID: 39941415
OK, it compiles but I can't create any folders. For example in the "create spec. folder" box I have:

s10001\Pictures\test

But I get the error "cannot create destination folder"

attached is the log
log.txt
0
 
LVL 26

Accepted Solution

by:
Sinisa Vuk earned 500 total points
ID: 39942220
Try this new one. Fixed few things... and Pos compile error too.
mtp12.zip
0
 

Author Comment

by:Clyde24
ID: 39943980
Strange - it works when creating a folder in the root "s10001", but not anywhere deeper

For example entering the following works:

s10001\test

However, the following does not:

s10001\pictures\test

Log is attached
log.txt
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 26

Expert Comment

by:Sinisa Vuk
ID: 39944016
Strange indeed. Works on my android phone, sd card, usb ...
But I have exposed drive letter, folders/files are with a real names....
Will look....
0
 

Author Comment

by:Clyde24
ID: 39944691
... also another issue I noticed - I Need to know the exact name of the device as shown in Windows explorer. For example, I have a "Garmin Oregon 650" GPSr unit connected:

gpsr
However, when I interrogate the mtp_demo log I can't see this exact reference (the 650 is missing, which is very important as that is the model number):

FriendlyName len=7
FriendlyName=GARMIN
DeviceDescription len=13
DeviceDescription=Oregon Flash

Open in new window


How can we get the exact name as shown by Windows explorer
0
 
LVL 26

Expert Comment

by:Sinisa Vuk
ID: 39945155
Can you post log for this Garmin issue....
using this newer example...
mtp13.zip
0
 

Author Comment

by:Clyde24
ID: 39946653
log attached
log.txt
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 40461049
I've requested that this question be deleted for the following reason:

The question has either no comments or not enough useful information to be called an "answer".
0
 

Author Closing Comment

by:Clyde24
ID: 40461050
I changed the code to just delete a single folder and it worked
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Virtualstringtree carsh after invalidate for while 5 86
Printing problem 2 80
drawing animated level bar based on numbers 3 86
Performance of SQL statement 37 95
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

4 Experts available now in Live!

Get 1:1 Help Now