Question regarding Using directives

717
8
Jump to solution
04-25-2013 06:08 AM
JimMeuse
New Contributor
Getting started in ArcObjects 10.1 SDK...

Within Visual Studio 2010, I entered in the following for Using directives:
using ESRI.ArcGIS.ArcMapUI;
using ESRI.ArcGIS.Desktop;
using ESRI.ArcGIS.esriSystem;
using ESRI.ArcGIS.Framework;

I tried creating an IMaps variable by entering:
IMaps pMaps = pMxDocument.Maps;

But I am getting an error "The type or namespace name 'IMaps' could not be found (are you missing a using directive or an assembly reference?)".  Based on Intellisense, I don't see what other directives I should use.  This seems like it should have an obvious answer which I am missing.
0 Kudos
1 Solution

Accepted Solutions
NeilClemmons
Regular Contributor III
using ESRI.ArcGIS.Carto;

View solution in original post

0 Kudos
8 Replies
NeilClemmons
Regular Contributor III
IMaps is in the Carto library.  You don't have a Using statement for Carto.
0 Kudos
JimMeuse
New Contributor
Thanks, Neil.  What do I need to do in order to get rid of the error?
0 Kudos
NeilClemmons
Regular Contributor III
Add the Using statement.
0 Kudos
JimMeuse
New Contributor
I'm sorry, I must appear appallingly slow...but what exactly do I need to type in my code?
0 Kudos
NeilClemmons
Regular Contributor III
using ESRI.ArcGIS.Carto;
0 Kudos
JimMeuse
New Contributor
Thanks again, Neil.

When I first typed in using ESRI.ArcGIS.Carto, I got the following error message: The type or namespace 'Carto' does not exist in the namespace 'ESRI.ArcGIS'.  Then within the Solution Explorer I right-clicked References >> Add Reference... and in the .NET tab I selected ESRI.ArcGIS.Carto.  Then no more error messages.

There are quite a few ESRI references in the list of references under .NET.  Is there some source which shows which specific references are required for specific interfaces which a user wants to use?
0 Kudos
NeilClemmons
Regular Contributor III
The topic for each interface/class in the developer help shows the library it is in.

http://resources.arcgis.com/en/help/arcobjects-net/componenthelp/index.html#
0 Kudos
JimMeuse
New Contributor
Thanks, I'll look that over.
0 Kudos