Path to portable device
-
Friday, May 22, 2009 7:39 PMI am using VB 2008 Express edition on Windows 7
While trying to write a small program to dowload MOV files from my Canon Ixus990 Digital camera,
I am unable to "see" the Camera.
The Camera shows in Window 7 as a Portable Device and the following code is as far as I have got.
Dim sourcepath As String
Dim pathfrom As String
Dim FolderBrowserDialog1 As New FolderBrowserDialog
sourcepath = "Computer\Canon DIGITAL IXUS 990 IS\Removable storage\"
With FolderBrowserDialog1
.SelectedPath = sourcepath
.ShowNewFolderButton = False
.Description = "Now select the source directory"
sourcePath = .SelectedPath & "\"
PathFrom = FolderBrowserDialog1.SelectedPath
End With
OpenFileDialog1.InitialDirectory = FolderBrowserDialog1.SelectedPath
With OpenFileDialog1
.FileName = vbNullString
.Filter = "Mov Files (*.MOV)/*.MOV/(.All Files (*.*)/*.*"
.FilterIndex = 1 '
.Multiselect = True
.CheckFileExists = True 'Only select existing files
.Title = "Ixus Mov Files"
If .ShowDialog() = System.Windows.Forms.DialogResult.OK Then
For Each filename As String In .FileNames
ListBox1.Items.Add(filename) 'Add files to list box
Next
ListBox1.Visible = True
End If
End With
This line is my problem.
"Computer\Canon DIGITAL IXUS 990 IS\Removable storage\"
This is the path I get by right clicking on the camera in windows and selecting properties.
I am sure that previous versions ofWindows treated the Camera as a hard drive and gave it a drive letter.
As I am a beginner any help is appreciated- Moved by Riquel_Dong Friday, May 29, 2009 9:37 AM one Window7 issue (From:Visual Basic General)
All Replies
-
Friday, May 22, 2009 9:31 PMYour code is wrong, the sourcepath = "Computer\Canon DIGITAL IXUS 990 IS\Removable storage\" the sourcepath should start with the Letter of the Drive. For Example my MP3 player, when i plugged in , i got this H:\Documents as directory, Documents is a folder i created inside my MP3. What you need to do , when you plugged in your camera, try to click on the drive in windows explorer and look at the address box, you will see the directory.
Also the filter is wrong .Filter = "Mov Files (*.MOV)/*.MOV/(.All Files (*.*)/*.*" , it should be .Filter = "Mov Files (*.MOV,*.mov)|*.MOV,*.mov | All Files (*.*) |*.*"
kaymaf
I hope this helps, if that is what you want, just mark it as answer so that we can move on -
Friday, May 22, 2009 9:43 PM
This is Windows 7 and the path shows without a drive letter, that is my problem.
"Computer\Canon DIGITAL IXUS 990 IS\Removable storage\" is the path that Windows 7
returns when right clicking on the camera, No drive letter.
All other drives on my system show with drive letters as normal. -
Friday, May 22, 2009 9:48 PM
Try this code below and see if you get the directory by select your drive from your code. i set your Title bar text to the selectpath
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim FileDir As New FolderBrowserDialog FileDir.ShowNewFolderButton = False FileDir.Description = "Now select the source directory" If FileDir.ShowDialog = DialogResult.OK Then Me.Text = FileDir.SelectedPath End Ifkaymaf
I hope this helps, if that is what you want, just mark it as answer so that we can move on -
Friday, May 22, 2009 10:04 PM
The same thing happens as does in my code.
I can delve into the directeories on the camera but as soon as I select the desired directory
the folderbrowser OK button becomes inactive -
Saturday, May 23, 2009 8:55 AMI should add that using windows explorer , allows me to delve into the directories in the camera as I should.
-
Friday, May 29, 2009 3:19 PMmust likely what you see is a shell namespace extension view that does not have a physical folder. If you don't see it in file dialogs, then it does not support Windows's file dialogs, so you can not access the shell namespace extension view in programs other than Windows Explorer.
MSMVP VC++ -
Sunday, May 31, 2009 5:37 PM"you can not access the shell namespace extension view in programs other than Windows Explorer"
Well you can, obviously, it's just that you have to go through the same set of Shell Namepsace APIs that Explorer does. -
Sunday, May 31, 2009 7:36 PMI have just stumbles across the fact that, if I press cance,l at the folderbrowserdialog, the filedialog allows me to browse the device !!
Will look to see what I can do with this info.
But all suggestions/help are still welcome. -
Friday, September 25, 2009 1:43 PM
I too am trying to copy files from a digital camera that only shows up as a portable device and not a mass storage device with a drive letter. Have you gotten any further with your project? What I am looking to do is copy files off a digital camera while keeping all the attributes with it (ie filename, date/time) and possibly delete the file from the flash card of the camera at the same time.
-
Friday, September 25, 2009 1:49 PMI have not been able to progress any further.
-
Wednesday, October 21, 2009 10:44 AM
I had a similar problem with an MP3 player which was recognized by Windows 7 as "Portable Device". I managed to get it to attribute a letter by manually updating the device's driver in Device Manager to "USB Mass Storage Device". Try it, and maybe you could change your approach to take advantage of this.
Have fun- Proposed As Answer by Kophein Wednesday, October 21, 2009 10:45 AM
-
Wednesday, October 21, 2009 11:56 AMCan you explain, more fully, how you went about this, please.
-
Saturday, February 26, 2011 3:38 PM
The Pict:
Did you ever get a resolution to this?
I am seeking the same answer.
-
Saturday, February 26, 2011 4:06 PMNo, I never did
-
Saturday, February 26, 2011 4:16 PMIf the camera is recognized by Windows Vista/7 as a "Portable Device", you can probably use Windows Portable Device APIs to enumerate/transfer files from the device.
The following is signature, not part of post
Please mark the post answered your question as the answer, and mark other helpful posts as helpful, so they will appear differently to other users who are visiting your thread for the same problem.
Visual C++ MVP -
Thursday, September 20, 2012 4:07 PM
Can u please tell me how do u did this?
" I managed to get it to attribute a letter by manually updating the device's driver in Device Manager to "USB Mass Storage Device" "
- Edited by samithaj Thursday, September 20, 2012 4:08 PM


