How to: Add an SLK to an Isolated Shell Project

After you obtain a shell load key (SLK), you must add it to your Shell project. Follow this procedure to add an SLK to a project that was created by using the Visual Studio Shell Isolated template.

Note

The Visual Studio Shell Isolated template creates a user interface (UI) project. A UI project requires a package load key (PLK), as do any other VSPackages that you add to your application.

To add an SLK to an isolated Shell project

  1. Open the project to which you want to add the SLK.

  2. In Solution Explorer, find the resource file that is associated with your application, for example, MyShellStub1.rc, and open it.

  3. Open the string table. The Visual Studio Shell Isolated template creates an entry for the SLK. The default entry has an ID of IDS_SLKSTRING, a value of 105, and a caption of "TODO: Enter SLK here". Replace the caption with the value of the SLK that you obtained for your Shell application, for example, as follows:

    ID

    Value

    Caption

    IDS_SLKSTRING

    105

    HZDEE1RRAZPJJ3JDDEKKMHDICMA2CACREPK9DPRDCDE8QTZRQZJJJDJ2A8CKZAZ9M3ZZECPIRADDQ1RIIKMKQ9ZHCZH3MKAKQ9CRE2C9C2PKIDH1JIZMHZMQQHDMQ9DQ

  4. Save and close the string table and the resource file.

  5. In Solution Explorer, find the .pkgdef file that is associated with your isolated Shell-based application, for example, MyShellStub1.pkgdef, and open it.

  6. In the .pkgdef file, verify that the correct values are defined under the [$RootKey$] key, as follows:

    Name

    Value

    ThisVersionDTECLSID

    The GUID of your application. This must match the Shell GUID value that you used to generate the SLK.

    AppName

    The name of your application. This must match the Shell Name value that you used to generate the SLK.

    CompanyName

    The name of your company. This must match the company name that you used to generate the SLK.

    ProductVersion

    The version string for your application. This must match the Shell Version value that you used to generate the SLK.

    ID

    The resource identifier for the SLK in the string table of the application, for example, as follows:

    "ID"=dword:00000069

    Note

    The identifier value in the .pkgdef file is represented in hexidecimal, but the corresponding value in the string table is represented in decimal.

  7. Rebuild the solution and verify that it compiles without errors. Visual Studio compiles the SLK into the application and registers it accordingly.

To test an SLK in an isolated Shell project

  1. In Solution Explorer, right-click the Shell project node and then click Properties. Under Configuration Properties, Debugging, add the /noVSIP switch to the Command Arguments field.

    This guarantees that Visual Studio examines the SLK instead of the DLK.

  2. Press F5 to start the program under the debugger.

    If Visual Studio validates the SLK, your application opens.

    If Visual Studio does not validate the SLK, a dialog box, which explains that a valid SLK is required for the application to run, is displayed. When you click OK, the application closes.

See Also

Tasks

How to: Obtain an SLK for a Shell-Based Application

Concepts

License Keys and Load Keys

Visual Studio Shell (Isolated Mode)

Change History

Date

History

Reason

July 2008

Revised to reflect changes in how SLKs are generated.

SP1 feature change.