Visual Studio Tip: Selecting a Deployment Device

Screenshot of Target Device combo box located on Visual Studio 2008 toolbarHere is a small tip for C++ Smart Device developers who use Visual Studio. While developing native applications it is common to target an older version of the Device SDK in order to produce a single executable that will run on a wide range of devices. For example you may purposely target the Pocket PC 2003 Device SDK in order for your executable to be compatible with any Windows Mobile 2003, 5.0, 6 or 6.1 device.

One problem with this technique is that by default the target device drop down used to select the device used for deployment and debugging purposes is filtered to only show the devices that match the selected version of the Device SDK.

If your application makes use of functions such as LoadLibrary and GetProcAddress to conditionally take advantage of functionality present in newer versions of the Windows Mobile operating system (as discussed previously) it can be handy to debug your application on a more recent version of Windows Mobile while still compiling against the older version of the Device SDK.

Luckily this can easily be achieved, but the feature is slightly hidden. If you open the Project Properties dialog (right click on the project within Solution Explorer and select Properties) you will be able to find a “Deployment Device” setting within the “Deployment” section. You will notice that this combo box displays all currently installed emulators for all versions of Windows Mobile. By selecting an emulator from this list and clicking OK you will notice that the Target Device combo box updates to reflect your selection even if the selected emulator is for a different version of Windows Mobile.

Screenshot of project settings dialog showing deployment device settings

Leave a Reply