|Command with Modal Dialog
This sample illustrates how you can create a command with a modal dialog. The dialog has a Rich Text Control with descriptions of the doucment, the dataframes it contains, and the layers in each dataframe.
It also has a 'Copy to Clipboard' button using which you can copy the description of the .MXD to the clipboard. You can easily modify this command so that it creates metadata for your MXD file in the format you prefer.
This sample used 'AtlControls.h' from the Microsoft ATL sample 'ATLCON' in order to facilitate working with
controls without MFC. This header file provides thin wrappers for windows controls, so that the user
experience is almost the same as when working with MFC controls.
How to use:
Goto www.microsoft.com <http:\\www.microsoft.com>.
Type "atlcontrols" into the search box.
Find the hit ATLControls_h.htm
Copy the code from the page, paste it in a new file and save it as AtlControls.h in this sample's directory.
Compile the sample and use it:
Open this sample's workspace and change the paths to esriCore.olb and ArcCATIDs.h in StdAfx.h so that they point to your ArcGIS installation.
Build this sample's DLL. This will also register the command in the appropriate component category.
In ArcMap, open the Customize dialog. Under the Commands tab, select the 'Map Document Description' command from the Developer Samples category, and drag it on to a toolbar. Dismiss the Customize dialog.
Click on the command. The modal dialog comes up with a description of the current map document.
Use the 'Copy to Clipboard' button to copy the contents of the Rich Text Control to the clipboard. Paste onto a text editor. Dismiss the dialog when done.
An open map document.
||Implementation file for the Map Document Description dialog.
||Header file for the Map Document Description dialog.
||Header file that defines thin classes for controls for use with ATL.
From Microsoft's ATLCON sample. Please download this file from the Microsoft
||Implementation file for the Map Document Description Command.
||Header file for the Map Document Description Command.
||Registry script file for the Map Document Description Command.
||Compiled DLL for project.
||Implementation of DLL Exports.
||Module Definition file, listing exported functions.
||The IDL file for the sample.
||Make file for Project.
||Module definition file for proxy-stub Code.
||Make file for proxy-stub code.
||Header file that includes standard system include files.
||Source file that includes just the standard includes.
||Bitmap for the command.
IApplication, IMxDocument, IDataset, IWorkspace, IArcInfoWorkspace, IFeatureDataset, IDataset, IPropertySet, IMaps, IMap, ILayer, IDataLayer, IName, IFeatureLayer, IFeatureClass, ITable, IGeoDataset, ISpatialReference, ISpatialReferenceInfo, IProjectedCoordinateSystem, IGeographicCoordinateSystem, IProjection, IDatum, IPrimeMeridian