How Do I Add a Toolbar Resource to the Snap-In Object?

By default, the MMC Snap-In wizard does not provide a toolbar resource for the snap-in template. The reason being that the ID of the toolbar resource is unknown at the time of creation. However, you can add a toolbar manually in a few steps.

  1. Create a toolbar resource for the snap-in project, using the Toolbar editor. Make sure that each toolbar button is 16 pixels wide by 16 pixels high.

  2. Locate the toolbar ID map of the snap-in object map of the data class of the snap-in object (located in the snapin_name.H file).

  3. Modify the map by adding an entry between BEGIN_SNAPINTOOLBARID_MAP and END_SNAPINTOOLBARID_MAP similar to the following:
    SNAPINTOOLBARID_ENTRY(IDR_TBARNAME)
    
  4. Save your changes to the project and rebuild.

Note   Use additional SNAPINTOOLBARID_ENTRY macros to add additional toolbar resources to the snap-in module.