开发者

Browse for folder can't see camera device

开发者 https://www.devze.com 2023-01-03 01:31 出处:网络
In Delphi 2010, I want to allow users to browse and select a folder. The folder is on a device (?) created by a DSLR.

In Delphi 2010, I want to allow users to browse and select a folder. The folder is on a device (?) created by a DSLR.

The folder is visible in the Windows Explorer as shown above. And, the folder is visible in a TOpenDialog, allowing them to browse into the folder and choose a file.

Unfortunately, I have been unable to get either SHBrowseForFolder (code I foun开发者_StackOverflow中文版d on the web but don't understand) or SelectDirectory to see the camera device or folder beneath it. (Side note: IMO, SelectDirectory is a far nicer UI, since the user can see the files in the folders while browsing.)

I assume this has to do with the fact that the folder is in a device (?) created by the camera software.

I've seen some tricks where you call TOpenDialog to browse for folders with '*.' and then ExtractFileDir on the result, but that's not robust or, IMO, a good UI.

What I'm looking for is a "Browse for folder" that can see the same devices (including the camera device) the TOpenDialog & Windows Explorer can see. (Ideally, it would have the nice appearance like the one below!)

Any suggestions?

Later: Capture Images from Camera connected to Computer and listed in Imaging Devices has what I was looking for.


The folder you're seeing in there is drawn up by a extension to Windows Explorer, it's not an "drive". It's there so you can easily copy stuff in and out of the device Using Windows Explorer. All operations are probably handled by the Windows Explorer Extension. Think of it this way: What PATH would the file on that device have? Without a PATH to the file you can't really open it from any Windows application!

Go into the menu of your DSLR camera, find the setting that tells it what to do when connected via USB to the PC and change that to "Storage Device" (anything that doesn't look proprietary, you probably have 2 or 3 options). By default your DSLR is set to an mode that allows it to talk to camera-automation software running on the PC! Once you change that setting to "storage device" Windows will treat it like any other USB storage device, will assign it a drive letter and you'll be able to access it from your Delphi application. Or do what most DSLR owners do, take out the card out of your DSLR and put it into your card reader.

Edit: From the name in the picture, you've got a Canon 350D camera. Go to the rightmost settings menu, find the Communication option, set it to "PC Connection". The default is: "Print/PTP". If you really want to work with a camera over the Print/PTP protocol, you most likely can, but you need to look for specific API's, because in that mode your camera's storage doesn't map into your file system, so you can't open stuff as files and folders.


It's because its a special device, not a fixed drive or flash drive. I have had this problem alot before. You have to save to somewhere and the copy with explorer.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号