Windows 7 Application Samples

The Windows Portable Devices (WPD) SDK includes two sample command-line applications written in C++. The first application, WpdApiSample, lets the user accomplish tasks like: enumerating connected devices, exploring objects on these devices, and enumerating object properties. The second application, WpdServiceApiSample, is designed to explore a Contacts Device Service. The user can enumerate connected device services,…

2

Windows 7 Portable Device Development Kits

There are several different resources made available to portable device manufacturers to assist in device firmware and driver development, and to application developers wishing to create applications that interact with these portable devices. These resources are provided and maintained by members of the Windows Portable Devices team. This post provides a description for the following…

1

Visual Basic .Net Sample for WPD

We’ve created a Visual Basic .Net sample for WPD and posted it to CodePlex: Microsoft’s open source project-hosting web site. Take a look at http://www.codeplex.com/wpdtempsensor In addition to the Visual Basic project and source files, we’ve posted a document that describes the sample. This document also describes how you can address and resolve the COM…

2

Creating a Temperature Sensor Gadget for Windows Sidebar with C++

The following post describes a gadget for Windows Sidebar that displays the temperature reading from a temperature sensor device. Similar applications could be written to display: battery-level or available memory for a portable media device, contact lists from a mobile phone or PDA, route lists from a GPS device, and so on. Introduction Microcontrollers are…

1

New Driver and Application Whitepapers Are Here

We’ve published two new WPD developer-centric whitepapers at the Microsoft WHDC website for WinHEC.    The first covers how to do WMDRM metering and license synchronization from a WPD application; the second describes how to port the existing WPD “Hello World” sample driver to communicate with a Parallax Basic Stamp II microcontroller to read temperature sensor data.   Both contain sample…

1

WPD Development Kits and Downloads

WPD Application Development To get started on developing a WPD application, download the Windows SDK (Windows Vista or later).  This contains the header and library files, build environment, and code for a sample WPD application.   Earlier versions of the Platform SDK do not include WPD. If you are sending MTP vendor extension commands in your WPD application, and…

1

WPD and WMDM Side-by-side: An Application Development Perspective

This post will compare WPD and the latest version of Windows Media Device Manager (WMDM), from an application developer’s point of view. Availability (aka SDK and Runtime Requirements) The Windows SDK contains the complete build environment (headers, libs, sample code …) for developing a WPD application for both 32 and 64-bit. The Windows Media Format 11 SDK (WMFSDK11) provides headers and libs for WMDM…

1

How to Receive WPD Arrival Event Notifications

If you followed the standard WPD events link in our previous post on WPD driver events, you may have seen the following event definition: WPD_EVENT_DEVICE_REMOVED This event is sent when a driver for a device is being unloaded. This is typically a result of the device being unplugged. Clients should release the IPortableDevice interface they have open on the device specified in…

1

Getting ERROR_BUSY (0x800700AA) after reading data from an MTP device?

One common cause of the ERROR_BUSY (0x800700AA) in MTP devices is when the application reads resource data from a content object on the portable device using IStream::Read(), and does not complete the read with an IStream::Close().   Subsequent operations that eventually translate into MTP commands into the device could fail with ERROR_BUSY because the resource read operation is not yet complete.     Sometimes the…

1

Object Creation: Required Properties and Debugging Failures

Basic Set of Properties for Folder Creation When creating a folder object, the following properties are required when calling IPortableDeviceContent::CreateObjectWithPropertiesOnly: WPD_OBJECT_PARENT_ID:  VT_LPWSTR, Parent Object ID WPD_OBJECT_NAME: VT_LPWSTR, Name of the new object WPD_OBJECT_CONTENT_TYPE = WPD_CONTENT_TYPE_FOLDER WPD_OBJECT_FORMAT = WPD_OBJECT_FORMAT_PROPERTIES_ONLY Some devices (such as the Toshiba MES30VW Gigabeat) require the following additional property when creating a folder object, or the object creation…