Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I'm trying to follow the Identify snippet from the ESRI ArcEngine SDK http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#/Do_Identify_Snippet/00490000000n000000/

The third line of the tutorial throws a COM exception

public void DoIdentify(ESRI.ArcGIS.Carto.IActiveView activeView, System.Int32 x, System.Int32 y)
  if(activeView == null) return;
  ESRI.ArcGIS.Carto.IMap map = activeView.FocusMap;
  ESRI.ArcGIS.CartoUI.IIdentifyDialog identifyDialog = new ESRI.ArcGIS.CartoUI.IdentifyDialogClass();  //THIS LINE THROWS THE EXCEPTION

{"Retrieving the COM class factory for component with CLSID {F8AAB776-8B1E-11D3-9F7A-00C04F6BC886} failed due to the following error: 80040111 ClassFactory cannot supply requested class (Exception from HRESULT: 0x80040111 (CLASS_E_CLASSNOTAVAILABLE))."}

I expect to run into some trouble using the snippets, but I can't even call a constructor... : (

Any thoughts are appreciated...

specs: ESRI ArcEngine 10 VS 2010 C#

Edit: Maybe I don't have access to the CartoUI library. I also tried this:

AdvancedDrawingDialogClass t = new ESRI.ArcGIS.CartoUI.AdvancedDrawingDialogClass(); 

But I got a similar error.

Edit 2 I found out how to do the identification so I'm going to post it for the community.

for (int i = 0; i < mapControl.LayerCount; i++)
  ILayer layer = mapControl.get_Layer(i);
  if (!(layer is IDynamicLayer))
    ESRI.ArcGIS.Carto.IIdentify identify1 = layer as IIdentify;
    IArray array = identify1.Identify(geometry);
    if (array != null)
      object obj = array.get_Element(0);
      IFeatureIdentifyObj fobj = obj as IFeatureIdentifyObj;
      IRowIdentifyObject irow = fobj as IRowIdentifyObject;
      IFeature feature = irow.Row as IFeature;
      IGeometry geometry1 = feature.Shape; 
I tried to use the identify UI in arcengine a few years back. Never really figured it out though. forums.esri.com/Thread.asp?c=159&f=1705&t=144001#418493 –  Kirk Kuykendall Jan 17 '11 at 18:08

1 Answer 1

up vote 3 down vote accepted

It's only available in Desktop and not Engine, according to the API documentation: IdentifyDialog CoClass


This site is currently not accepting new answers.

Not the answer you're looking for? Browse other questions tagged .