Поделиться через


Creating a New Custom or Data Resource

You can create a new custom or data resource by placing the resource in a separate file using normal resource script (.rc) file syntax, and then including that file by right-clicking your project in Solution Explorer and clicking Resource Includes on the shortcut menu.

To create a new custom or data resource

  1. Create a .rc file that contains the custom or data resource.

    You can type custom data in a .rc file as null-terminated quoted strings, or as integers in decimal, hexadecimal, or octal format. For more information, see the Resources section of the Windows SDK.

  2. In Solution Explorer, right-click your project's .rc file, then click Resource Includes on the shortcut menu.

  3. In the Compile-Time Directives box, type a #include statement that gives the name of the file containing your custom resource. For example:

    #include mydata.rc
    

    Make sure the syntax and spelling of what you type are correct. The contents of the Compile-Time Directives box are inserted into the resource script file exactly as you typed them.

  4. Click OK to record your changes.

Another way to create a custom resource is to import an external file as the custom resource. For more information, see Importing and Exporting Resources.

For information on adding resources to managed projects, please see Resources in Applications in the .NET Framework Developer's Guide. For information on manually adding resource files to managed projects, accessing resources, displaying static resources, and assigning resources strings to properties, see Walkthrough: Localizing Windows Forms and Walkthrough: Using Resources for Localization with ASP.NET.

Requirements

Win32

See Also

Reference

Binary Editor