path to iPhone DCIM Directory

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

User avatar
AUGE_OHR
Posts: 2060
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: path to iPhone DCIM Directory

Post by AUGE_OHR »

danielmaximiliano wrote: Fri Apr 03, 2020 12:56 pm I am testing your development and I found a Tole error that I attached in the image
did you twice press BUTTON SearchDevices :?:

Code: Select all

FUNCTION GetDeviceList()
LOCAL oShell
...
   oShell := CreateObject( "shell.application" )
this create a new Instance and old is NOT "destroy" (as i need later)

i use Object now as Field-wide Static which are like MEMBER in a CLASS
as Code use OOP Syntax i "think" about a CLASS ... :idea:
have fun
Jimmy
User avatar
AUGE_OHR
Posts: 2060
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: path to iPhone DCIM Directory

Post by AUGE_OHR »

hi,

i "think" there is a missing 5th Parameter in

Code: Select all

Form_1.Tree_1.CARGO(nItemID) := { .T., oStorageFile:Path, oStorageFile:Size, oStorageFile:Type }
while

Code: Select all

Form_1.Tree_1.CARGO(nItemID) := { .F., oStorageFile:Path, oStorageFile:Size, oStorageFile:Type, oStorageFile}
and

Code: Select all

function CopyFiles
         oFile := Form_1.Tree_1.Cargo(nValue)[5]
have fun
Jimmy
User avatar
mol
Posts: 3718
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: path to iPhone DCIM Directory

Post by mol »

fifth parameter is needed only for files at now - I didn't realized copy of folders.

With My Xiaomi MI 9T PRO everything works OK.
It lasts few minutes to get content of phone because of scanning whole device. It's realized with recursion.
I can realize scanning folder by folder manually - by DBLClick, but, I have no idea how to select items to copy by DBLClick then
User avatar
AUGE_OHR
Posts: 2060
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: path to iPhone DCIM Directory

Post by AUGE_OHR »

hi,
mol wrote: Sat Apr 04, 2020 6:58 am fifth parameter is needed only for files at now - I didn't realized copy of folders.
YES, all with 1st Element = .T. are just Folder and not used for COPYHERE()

---

have play with your Code and found out how to "mark" files for COPYHERE() :D
have to Dblclick on last Folder Tree Item than all Item in Folder are "select" and i can start transfer.

it does work with Object from Array :P

Code: Select all

   oFile := Form_1.Tree_1.Cargo(nValue)[5]
   oDestFolder:CopyHere( oFile, xFlag )
but something is going on while he ask me for "dupe" :shock: ... it was a empty folder ...
than it seems to run ... still running ... hm
now sure why it take much more time than need ... hm

p.s. i like Progressbar so i can guess how long it take ;)
mol wrote: I can realize scanning folder by folder manually - by DBLClick, but, I have no idea how to select items to copy by DBLClick then
That i also have try that but no Concept found yet ...

Code: Select all

   ON DBLCLICK DoTreeAction(This.Value)  ;
when DblClick i "try" to "check" if Node have Sub-Folder which have Item or more Sub-Folder.
i can´t use
<ParentWindowName>.<TreeControlName>.IsTrueNode ( nValue ) --> Only returns .T. if the item contain sub-items (child items).
when Sub-Items was not create before
so what is the Solution ... :idea:

---

hm ... :idea:
what about a Array with {nParent, nChild , nGrandchildren} so when on nChild you got before

Code: Select all

 <ParentWindowName>.<TreeControlName>.ParentValue
and after

Code: Select all

 <ParentWindowName>.<TreeControlName>.ChildValue 
if ChildValue is empty ... create Child :lol:

p.s.
when using FUNCTION Code i recommend to use Field-wide STATIC for Object like MEMBER in a CLASS.
so you have Object for next loop as "Parent" also in other Instance if Code is in same PRG
have fun
Jimmy
User avatar
AUGE_OHR
Posts: 2060
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: path to iPhone DCIM Directory

Post by AUGE_OHR »

hi,

i got a Lumia 550 with Windows Mobile for Test and it have "much more" Folder.
WinPhone.JPG
WinPhone.JPG (23.69 KiB) Viewed 1874 times
i test it with Code from Marek and it work better with COPYHERE() :)
... but still "seems" to make some "pause" between

---

the Difference of Marek Code to my first Version are using Array for "different" Object.
i do "stop" if i got right Object to use it as Parent for next Level.

so i use same Way twice to be sure and pass "active" Object for transfer

Code: Select all

   DoCopySingle( oDirFolder, cTarget )

PROCEDURE DoCopySingle( oDirFolder, cTarget )
LOCAL obj     := CreateObject( "Shell.Application" )
LOCAL oTarget := obj:NameSpace( cTarget )

   iMax := oDirFolder:Count
   FOR i := 1 TO iMax
      // if Checkbox is marked
      IF IPHONE.Grid_1.CheckBoxItem( i ) = .T.
         // get Item Object
         oFile := oDirFolder:Item( i - 1 )
         oTarget:CopyHere( oFile, xFlag )
i pass Folder Object, create a new Shell Object and get "fresh" FolderItem -> File-Object

Marek use

Code: Select all

   oFile := Form_1.Tree_1.Cargo(nValue)[5]
which IS right file ... but Element of Array is IMHO a Reference to Original.

that "might" make Problem with "locking" which lead to that "pause" between.
IMHO it is not COPYHERE() itself which you can check on large Transfer (Video)

---

Idea :

Code: Select all

   .CARGO have .F. as 1st Parameter which is use for Transfer.
these are all FileItem which are in active Folder.

what about to use active Folder as Start to create "fresh" FileItem for COPYHERE() :idea:
have fun
Jimmy
User avatar
AUGE_OHR
Posts: 2060
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: path to iPhone DCIM Directory

Post by AUGE_OHR »

hi,

so here now new Design using Concept from Marek with CARGO and Array
TreeGrid.jpg
TreeGrid.jpg (314.33 KiB) Viewed 1846 times
it use a DblClick to "build" a Sub-Node "on-fly"
when it have items in Folder it will shown in GRID.

! Note : "transfer" or "Thumbs" are NOT include at this Time ( but Dummy Code is include )
IPHONE13.zip
(4.67 KiB) Downloaded 143 times
have fun
Jimmy
User avatar
danielmaximiliano
Posts: 2611
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Contact:

Re: path to iPhone DCIM Directory

Post by danielmaximiliano »

AUGE_OHR wrote: Mon Apr 06, 2020 11:18 am
! Note : "transfer" or "Thumbs" are NOT include at this Time ( but Dummy Code is include )
Hi Jimmy :
i found this for thumbs images
https://docs.microsoft.com/en-us/dotnet ... ail-images
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
User avatar
AUGE_OHR
Posts: 2060
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: path to iPhone DCIM Directory

Post by AUGE_OHR »

hi,
danielmaximiliano wrote: Mon Apr 06, 2020 1:56 pm i found this for thumbs images

Code: Select all

https://docs.microsoft.com/en-us/dotnet/framework/winforms/advanced/how-to-create-thumbnail-images
hm ... this is GDI+ Code ...
i have not use GDI+ before and i´m not a "C"-Programmer ...
have fun
Jimmy
User avatar
AUGE_OHR
Posts: 2060
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: path to iPhone DCIM Directory

Post by AUGE_OHR »

hi,

have work on Transfer and wonder why i got "dupe" Message ... :o
Apple_Dupe.JPG
Apple_Dupe.JPG (54.98 KiB) Viewed 1822 times
this is on Apple iPhone ... "same" Picture but "dupe" ... :shock:
so have a look on your Phone when you get "dupe" Message ;)

---

i have add lTransfer as Parameter instead of PUBLIC and include DoCopySingle()

Code: Select all

PROCEDURE DoTreeRecursiv( xFolder, xLevel, xParent, xRecursiv, lProgress, lTransfer )
   DEFAULT lProgress TO .F.
   DEFAULT lTransfer TO .F.
   IF NIL <> xFolder
      xItems := xFolder:GetFolder:Items()
      // new Transfer
      IF lTransfer = .T.
         DoCopySingle( xItems, cTarget )
      ELSE
         iMax := xItems:Count
         FOR i := 1 TO iMax
do start Transfer i use this

Code: Select all

STATIC PROCEDURE Start_CopyHere()
LOCAL nItem   := IPHONE.Tree_1.Value
*LOCAL cThis   := IPHONE.Tree_1.Item( nItem )
LOCAL aSelect, xFolder, xName, xLevel, xParent, xElement

   IF !EMPTY( aGridfiles )
      IF nItem > 0
         aSelect := aFolder[ nItem ]
         xFolder := aSelect[ ID_Folder ]
         xName := aSelect[ ID_Name ]
         xLevel := aSelect[ ID_Level ]
         xParent := aSelect[ ID_Parent ]
         xElement := aSelect[ ID_Element ]
         // last Parameter = lTransfer
         DoTreeRecursiv( xFolder, xLevel, xParent, .F., .T., .T. )
      ENDIF
   ENDIF
RETURN
i have add Progressbar to DoCopySingle() with fixed CalcPos() and "un-Check" files which are transfer but no Code change

have to cleanup Code before next Release.
have fun
Jimmy
User avatar
AUGE_OHR
Posts: 2060
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: path to iPhone DCIM Directory

Post by AUGE_OHR »

hi,

here clean-up Code with COPYHERE()
IPHONE15.ZIP
(4.7 KiB) Downloaded 136 times
i have try to find a Way to identify "real Drive" from "This PC"
but again i got Problem to "translate" German Name like BILDER -> PICTURE

COPYHERE() only work for Device so i want to "hide real Drive" as they won´t work with COPYHERE() ... you need SHFile API
have fun
Jimmy
Post Reply