Question regarding Using directives

267
8
Jump to solution
04-25-2013 06:08 AM
Highlighted
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.
Reply
0 Kudos
1 Solution

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

View solution in original post

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

View solution in original post

Reply
0 Kudos
Highlighted
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?
Reply
0 Kudos
Highlighted
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#
Reply
0 Kudos
Highlighted
New Contributor
Thanks, I'll look that over.
Reply
0 Kudos