Udostępnij za pośrednictwem


How to: Using the Wizard to Create a Multiplatform Device Project

There are advantages to using the Smart Device Application Wizard to create a multiplatform device project when you create a project, instead of adding a platform after the project has been created. These are as follows:

  • When you select more than one platform on the Platforms page in the application wizard, a resource file is generated and configured for each of your platforms. However, if you add a platform after you create your project, you will have to manually add platform and resource files. For more information, see Using Resources on Multiple Platforms.

  • When you select more than one platform on the Platforms page in the application wizard, the generated files have an #if defined statement embedded in the source to allow for multiplatform coding. However, if you add a platform after you create your project, you will have to manually add the #if defined statement to the appropriate sections of the code.

The following procedures show how to use each of these techniques. For more information, see Code Explanation: Wizard-Generated Code in Visual C++ Device Projects.

Note

Your computer might show different names or locations for some of the Visual Studio user interface elements in the following instructions. The Visual Studio edition that you have and the settings that you use determine these elements. For more information, see Visual Studio Settings.

To create a multiplatform device project by using the New Project Wizard

  1. On the File menu, point to New, and then click Project.

    The New Project dialog box appears.

  2. Under Project types, expand the Visual C++ node, click Smart Device, and then click MFC Smart Device Application or another one of the available project types.

  3. In the Name box, type MultiPlatformProject.

  4. In the Location box, verify where you want to store your project files, and then click OK.

    The <Project Type> Smart Device Application Wizard appears.

  5. Click Next, and then on the Platforms pane, select the platforms you want to target, such as Pocket PC 2003 and Smartphone 2003.

  6. Click Finish.

    Your project is displayed in Solution Explorer.

To add a new device configuration using the Configuration Manager

  1. On the Visual Studio Build menu, click Configuration Manager.

    The Configuration Manager dialog box appears.

  2. On the Active solution configuration drop-down list, click New to add a new configuration.

    The New Solution Configuration dialog box appears.

  3. In the Name box, type a name for the new configuration.

  4. In the Copy settings from box, specify an existing configuration.

  5. Click OK.

See Also

Tasks

How to: Add a New Platform to a Device Project

How to: Change the Default Device (Native Projects)

Using Resources on Multiple Platforms