PRB: Project in PDK MMC Sample Does Not Build SnapIn Properly

Last reviewed: March 17, 1998
Article ID: Q182460
The information in this article applies to:
  • Microsoft Management Console, version 1.0 on the following platforms:

    - Windows NT - x86

SYMPTOMS

The project file for the Microsoft Management Console (MMC) Sample located in the Platform SDK does not build and register the SnapIn properly. This article outlines steps you can take to modify the sample so that it will build and execute properly.

CAUSE

The sample is incomplete. The SnapIn that is created does not properly register itself.

RESOLUTION

You need to take the key values described in the .ini files and convert them to registry script files. To do this, modify the project file as follows:

  1. Add the About.Cpp file to the file list.

  2. Change the options on the About.Cpp file so that it does not try to compile the precompiled headers file. Stdfx.Cpp is the file that insures that these headers are properly handled. Change this option as follows:

    a. Click Projects, and then Settings.

    b. Expand the Source Files folder.

    c. Highlight the About.Cpp file.

    d. Click the C++ Property Page.

    e. Set the Category to Precompiled Headers.

    f. Click Use Precompiled Header File.

    g. Type "stdafx.h" in the edit control for Through Header:.

    h. Click the SnapIn Icon at the top.

    i. Select the General Property Page.

    j. Use the MFC libraries. It does not matter if you statically link to

          them or use them as a shared DLL.
    

    k. Click OK.

  3. If you are working with the debug configuration, you need to copy the debug versions of the MFC DLLs and libraries in the appropriate directories on your system.

  4. Register the SnapIn. The *.ini files included in the sample contain the appropriate key values. These files need to be converted to Registry script files. The contents of the registry script files are included in the MORE INFORMATION section of this article.

  5. Once the SnapIn is properly registered, it should appear in the Add Remove SnapIn box.

STATUS

Microsoft is researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

Extension.ini Converted to a registry script file:

   REGEDIT4

   [HKEY_LOCAL_MACHINE\Software\Microsoft\MMC\SnapIns\{27E5EC4E-9F2D-11D0-
    A7D6-00C04FD909DD}]
   "NameString" =  "Extension"
   [HKEY_LOCAL_MACHINE\Software\Microsoft\MMC\SnapIns\{27E5EC4E-9F2D-11D0-
    A7D6-00C04FD909DD}\StandAlone]
   [HKEY_LOCAL_MACHINE\Software\Microsoft\MMC\SnapIns\{27E5EC4E-9F2D-11D0-
    A7D6-00C04FD909DD}\NodeTypes]
   [HKEY_LOCAL_MACHINE\Software\Microsoft\MMC\SnapIns\{27E5EC4E-9F2D-11D0-
    A7D6-00C04FD909DD}\NodeTypes\{65ca8054-9f4d-11d0-a7d6-00c04fd909dd}]
   [HKEY_LOCAL_MACHINE\Software\Microsoft\MMC\SnapIns\{27E5EC4E-9F2D-11D0-
    A7D6-00C04FD909DD}\NodeTypes\{e5092d22-1d7e-11d0-a29b-00c04fd909dd}]
   [HKEY_LOCAL_MACHINE\Software\Microsoft\MMC\SnapIns\{27E5EC4E-9F2D-11D0-
    A7D6-00C04FD909DD}\NodeTypes\{e6092d22-1d7e-11d0-a29b-00c04fd909dd}]
   [HKEY_LOCAL_MACHINE\Software\Microsoft\MMC\NodeTypes\{44092d22-1d7e-
    11d0-a29b-00c04fd909dd}]
   [HKEY_LOCAL_MACHINE\Software\Microsoft\MMC\NodeTypes\{44092d22-1d7e-
    11d0-a29b-00c04fd909dd}\Extensions]
   [HKEY_LOCAL_MACHINE\Software\Microsoft\MMC\NodeTypes\{44092d22-1d7e-
    11d0-a29b-00c04fd909dd}\Extensions\NameSpace]
   "{27E5EC4E-9F2D-11D0-A7D6-00C04FD909DD}" = "Sample extension snapin"
   [HKEY_LOCAL_MACHINE\Software\Microsoft\MMC\NodeTypes\{44092d22-1d7e-
    11d0-a29b-00c04fd909dd}\Extensions\PropertySheet]
   "{27E5EC4E-9F2D-11D0-A7D6-00C04FD909DD}" = "Sample extension snapin"

Sample.ini converted to a Registry script File:

   REGEDIT4

   [HKEY_LOCAL_MACHINE\Software\Microsoft\MMC\SnapIns\{18731372-1D79-11D0-
    A29B-00C04FD909DD}]      = REG_SZ "PDC Sample Snapin"
           "NameString" = "Sample"
   [HKEY_LOCAL_MACHINE\Software\Microsoft\MMC\SnapIns\{18731372-1D79-11D0-
    A29B-00C04FD909DD}\About] = "{F0A1B9BE-A172-11D0-A7D7-00C04FD909DD}"
   [HKEY_LOCAL_MACHINE\Software\Microsoft\MMC\SnapIns\{18731372-1D79-11D0-
    A29B-00C04FD909DD}\StandAlone]
   [HKEY_LOCAL_MACHINE\Software\Microsoft\MMC\SnapIns\{18731372-1D79-11D0-
    A29B-00C04FD909DD}\NodeTypes]
   [HKEY_LOCAL_MACHINE\Software\Microsoft\MMC\SnapIns\{18731372-1D79-11D0-
    A29B-00C04FD909DD}\NodeTypes{44092d22-1d7e-11d0-a29b-00c04fd909dd}]
   [HKEY_LOCAL_MACHINE\Software\Microsoft\MMC\SnapIns\{18731372-1D79-11D0-
    A29B-00C04FD909DD}\NodeTypes{55092d22-1d7e-11d0-a29b-00c04fd909dd}]
   [HKEY_LOCAL_MACHINE\Software\Microsoft\MMC\SnapIns\{18731372-1D79-11D0-
    A29B-00C04FD909DD}\NodeTypes{66092d22-1d7e-11d0-a29b-00c04fd909dd}]

REFERENCES

HTTP://www.microsoft.com/management, Microsoft Management Console Web pages Microsoft Management Console Overview Document Microsoft Management Console PDK Samples


Additional query words: MMC, sample, extension
Keywords : kbMmc
Version : WINDOWS:1.0
Platform : WINDOWS
Issue type : kbprb


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: March 17, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.