Microsoft KB Archive/298727

From BetaArchive Wiki

MMC SAMPLE: Implementing IExtendContextMenu

Q298727



The information in this article applies to:


  • Microsoft Management Console, version 2.0





SUMMARY

The sample project provided through this article demonstrates how to implement IExtendContextMenu to add items to the Management Console's default context menu.



MORE INFORMATION

The following file is available for download from the Microsoft Download Center:


MMC_ContextMenu.exe

Release Date: Jun-12-2001

For additional information about how to download Microsoft Support files, click the article number below to view the article in the Microsoft Knowledge Base:

Q119591 How to Obtain Microsoft Support Files from Online Services

Microsoft used the most current virus detection software available on the date of posting to scan this file for viruses. Once posted, the file is housed on secure servers that prevent any unauthorized changes to the file.

The MMC_ContextMenu.exe file contains the following files:

{|

! File ! Purpose |- | About.cpp | Implements ISnapinAbout |- | About.h | Defines class CSnapinAbout |- | AddDeviceDlg.cpp | Implements a modeless dialog box |- | AddDeviceDlg.h | Defines class CAddDeviceDlg |- | BaseDialog.cpp | Base class for modeless dialog boxes |- | BaseDialog.h | Defines class CBaseNode |- | BaseNode.h | Base class for node objects |- | BaseSnap.cpp | Implements COM and DLL functions |- | BaseSnap.h | Defines COM and DLL functions |- | Comp.cpp | Implementation of IComponent2 |- | Comp.h | Defines class CComponent |- | CompData.cpp | Implementation of IComponentData2 |- | CompData.h | Defines class CComponentData |- | ContextMenu.aps | Binary local resource file |- | ContextMenu.def | Defines project exports |- | ContextMenu.dsp | Project file for Microsoft Visual C++ |- | ContextMenu.dsw | Workspace file for Visual C++ |- | ContextMenu.ncb | Binary classview file |- | ContextMenu.opt | Binary workspace options file |- | ContextMenu.plg | Build log in HTML format |- | ContextMenu.rc | Resource template file |- | DataObject.cpp | Implementation of IDataObject |- | DataObject.h | Defines class CDataObject |- | DeviceNode.cpp | Node class for top-level nodes |- | DeviceNode.h | Defines class CDeviceNode |- | FolderNode.cpp | Node class for second-level nodes |- | FolderNode.h | Defines class CFolderNode |- | Globals.cpp | Implementation of global functions |- | Globals.h | Defines variables used globally |- | Guids.h | Defines GUIDs used in this project |- | LListImpl.cpp | A linked list class |- | LListImpl.h | Defines class CLListImpl |- | Readme.txt | Useful information about this project |- | Registry.cpp | Implementation of registry functions |- | Registry.h | Defines registry functions |- | Resource.h | Header file for resources |- | StaticNode.cpp | Node class for static node |- | StaticNode.h | Defines class CStaticNode |- | TraceMacro.cpp | Implements custom tracing functions |- | TraceMacro.h | Defines custom tracing functions |- | \Res\AppImg16.bmp | 16x16 application bitmap |- | \Res\AppImg32.bmp | 32x32 application bitmap |- | \Res\Nodes16.bmp | 16x16 bitmap strip |- | \Res\Nodes32.bmp | 32x32 bitmap strip |- | \Res\Snapin.ico | Icon file use by ISnapinAbout |- | \Res\UUID.txt | UUID file generated by UUIDGEN |- | | |}

The MMC_ContextMenu.exe contains the C++ source files needed to build a Microsoft Management Console (MMC) snap-in that implements IExtendContextMenu.

To build the project, expand MMC_ContextMenu and open ContextMenu.dsw in Microsoft Visual C++ version 6.0 or later.

This project requires MMC 2.0 to run. MMC 2.0 is available with Windows XP or Whistler Beta 2 or later. Also required are the MMC 2.0 header files and libraries from the Microsoft Platform SDK for Whistler Beta 2 or later. These are available from the Microsoft Download Center:

http://www.microsoft.com/downloads/search.asp

Additional Product Features

This project includes a simple modeless dialog class. This class is implemented in the files CBaseDialog.h and CBaseDialog.cpp.

Because the MMC SDK samples do not have dependencies on Active Template Library (ATL) or Microsoft Foundation Classes (MFC), this class is included to simplify the adding of modeless dialog boxes in response to user interface events, such as selection of an item from a context menu. Note that modal dialog boxes and property sheets should never be used in a snap-in. Use of modal dialog boxes or property sheets blocks the Management Console's primary thread and prevents other snap-ins in the same console from functioning correctly.

Additional query words: MMC_ContextMenu MMC_Samples2

Keywords : kbfile kbDSupport
Issue type : kbinfo
Technology : kbAudDeveloper kbMMCSearch kbMMC200


Last Reviewed: June 12, 2001
© 2001 Microsoft Corporation. All rights reserved. Terms of Use.