wpd

How to construct path for mtp devices (usable in folder browse dialog)?

烂漫一生 提交于 2021-01-04 06:41:50
问题 I implemented file transfer from windows pc to an android device, which is connected with MTP to the computer. The copy implementation is ready (I used this example: http://code.msdn.microsoft.com/windowsdesktop/Portable-Devices-COM-API-fd4a5f7d). Now I would like to improve UI, I would like to offer a folder selection dialog, where the user can select a MTP device folder, where I will save the file (CLSID_FileOpenDialog with FOS_PICKFOLDERS works nice). Note that simple file save dialog

WinAPI calls to access USB storage which has no drive letter?

寵の児 提交于 2020-01-12 16:49:33
问题 I've noticed, that some USB storage devices don't register in Windows as regular drives, in that they don't even get assigned a drive letter. Therefore, I can't apparently access them using the standard file operations C API. What are the WinAPI calls I can use to do some normal file operations on those strange devices - so: find/enumerate those devices at all, browse the file/directory tree on the device and get some file stats (size, modification date, etc.), read/write contents of the

in WPF, DataGridTextColumn's value is not rolled back after calling datagrid.CancelEdit()

亡梦爱人 提交于 2019-12-24 17:07:09
问题 I have a Data Grid containing two text columns. A user is allowed to modify the default value(which is 1). on Button click i am showing a confirmation message if user press yes ,data grid text column's value should be saved with new values and in case of No , Grid text column's value should be rolled/reset back to default or previous value. The issue lies,when a user clicks on No button from confirmation message, Data grid text column values are not rolled back or resetting to default .

System.AccessViolationException when copying data to portable device after installing windows 10 creators update 1703

放肆的年华 提交于 2019-12-22 06:37:08
问题 I am attempting to transfer content to portable device using this code snippet IPortableDeviceValues values = GetRequiredPropertiesForContentType(fileName, parentObjectId); IStream tempStream; uint optimalTransferSizeBytes = 0; content.CreateObjectWithPropertiesAndData( values, out tempStream, ref optimalTransferSizeBytes, null); System.Runtime.InteropServices.ComTypes.IStream targetStream = (System.Runtime.InteropServices.ComTypes.IStream)tempStream; try { using (var sourceStream = new

Transferring files from Android WPD device to PC

一曲冷凌霜 提交于 2019-12-21 09:39:09
问题 My Android app produces some files that I need to synchronize with my main PC program and the other way around. The common way I do this is using a FTP account where both my Android app and my PC program gets the latest version of the files, and this works just fine. Some of my clients does not have internet access on their Android devices, and so will have to synchronize with my program by connecting to the PC with a USB cable. For this I have a routine in my PC program that will synchronize

Alternatives to WPD/WIA on Windows XP?

与世无争的帅哥 提交于 2019-12-21 05:12:10
问题 WPD does not work correctly on Windows XP (SP1 if that matters), even if Microsoft states it does. Problem with WPD: IPortableDeviceManager.GetDevices call does not find any devices on Win XP while it finds all connected cameras on Windows 7. A few other people had this same problem with WPD not working on XP, no solution: 1 2 I have decided to reimplement the functionality using WIA. Problem with WIA automation/WIA interfaces: WIA automation offers only silly dialogs when interacting with

WPD equivalent of WIA DeviceDlg

落花浮王杯 提交于 2019-12-14 01:44:48
问题 I'm adding Windows Portable Devices (WPD) support to an app that currently uses Windows Image Acquisition (WIA). WIA provides a handy picture selection dialog via IWiaItem::DeviceDlg. I can't find a WPD equivalent. Is there one, and, if not, what is the preferred technique to allow users to select items? I don't have to write my own dialog, do I? 回答1: Response from MS: [T]here is no dedicated dialog for picture selection (outside of WIA). Instead, you should use the regular file open dialog

WIA versus WPD Digital Camera Image Acquisition and API

让人想犯罪 __ 提交于 2019-12-12 13:30:01
问题 We have a Windows Forms app running on XP that uses WIA to retrieve images from digital cameras attached to our company's field technician laptops. As clunky as the COM wrappers and APIs are, they've handled millions of images reliably. Looking now at inevitable migration to Win 7 and wondering if we should move from WIA to WPD (Windows Portable Devices) API. Does anyone have experience migrating from WIA to WPD? Or just working with WPD? Any pros or cons of staying WIA or going to WPD?

WPD MTP stream hangs on commit

我的梦境 提交于 2019-12-12 01:54:17
问题 I am using the following code to copy a file wrapped by a FileInfo object to an MTP device using the Windows Portable Device API: public static void CopyFileToDevice(PortableDeviceFolder parent, string name, FileInfo file) { IPortableDeviceValues values = GetRequiredPropertiesForContentType(parent.Id, name, file.Length); PortableDeviceApiLib.IStream tempStream; uint blockSize = 0; parent.Device.Content.CreateObjectWithPropertiesAndData( values, out tempStream, ref blockSize, null); System

Determine WPD device type in Delphi

六月ゝ 毕业季﹏ 提交于 2019-12-12 01:47:11
问题 I'm trying to determine what type my WPD device is in Delphi. In my application I need to know if the device is a Phone or Camera or what ever it is. According to this MSDN article the WPD Device Type is a WPD Device Property which can be read by reading the properties of the device. Then according to this MSDN article properties and attributes are defined as PROPERTYKEY structures with two parts: a category GUID, and a unique ID for that category. I've found GUID and Uinique ID for WPD