Using the Resource Editors for Device Projects

The Resource editors for device projects are almost identical to the Resource editors for desktop projects. Every editor is supported, and only the Dialog editor has any significant changes. For more information, see Resource Editors.

Native smart device projects in Visual Studio support the following Resource types:

  • Accelerator

  • Bitmap

  • Cursor

  • Dialog

  • Icon

  • Menu

  • Registry

  • String Table

  • Toolbar

  • Version

Dialog Editor

The device Dialog editor differs from the desktop Dialog editor in the following ways:

  • Some controls are missing from the desktop controls and the controls supported on devices have slightly different properties than the corresponding desktop control. For more information, see Device Dialog Box Controls.

  • There are new Dialog templates for popular device form factors.

  • The behavior and properties of the dialog box controls are derived from a user interface (UI) model that accompanies each installed software development kit (SDK). This UI model provides the correct set of controls for the currently targeted platform. If the SDK does not define a UI model, the Dialog editor defaults to the Windows CE UI model.

  • There are two controls unique to device projects: the State of Input Panel Control, and the CAPEdit Control.

RC2 File(s)

Some of the Application Wizards generate an .RC2 resource file and the standard (.RC) resource file. This .RC2 file is not intended to be compiled by the Resource Compiler; actually, it contains resources that the Resource Compiler does not handle. Examples include the HI_RES_AWARE custom resource and Menu Resource Data (RCDATA). The .RC2 file is a great location to put your other custom resources that you do not want the Resource Compiler editing for you.

For more information about how to create Menu resources for Smartphone, see How to: Create a Soft Key Bar. To create a Smartphone menu, make sure that you have an RCDATA section. Typically, this will be found in the .RC2 file. Resource IDs should have values greater than or equal to 100. The IDs are set in the resource header file (resourcesp.h for Smartphone). Buttons should have an NOMENU as their index (IDR_MENU RCDATA). The following example illustrates this point:

BEGIN
    IDR_MENU, 
    2,
    I_IMAGENONE, IDM_OK, TBSTATE_ENABLED, TBSTYLE_BUTTON | TBSTYLE_AUTOSIZE,
    IDS_OK, 0, NOMENU,
    I_IMAGENONE, IDM_HELP, TBSTATE_ENABLED, TBSTYLE_DROPDOWN | TBSTYLE_AUTOSIZE,
    IDS_HELP, 0, 0,
END

When working with Resource editors for devices you may get errors for the following reasons:

  • Because you modify a RESX item that belongs to another project item such as a Form or a user-control.

  • Because the Windows form designer automatically discards any item that does not link to a control. It also removes all comments, does not support linked items, and does not load the form or user-control if one has been added to the RESX file in the Resource editor.

  • Because some resource types such as .tiff files are not supported on Windows CE.

  • Because an error is also generated when the resource file's format is unsupported, the file is empty, or the format is corrupted.

See Also

Other Resources

Resource Editors for Device Projects