problem with using featureclass

Discussion created by jcommops on Jul 20, 2011

I use ArcObjects for an application that will permit me to automatically update my legend by making a count on my entity by filter. The recovery of my mxd is OK, also that of my layer and that of my field that I want to work too. This for when I want to retrieve the FeatureClass (entity) layer of my method returns null me and I do not understand why.

Here is my code:

EngineInitializer.initializeEngine ();
MapDocument mapDocument MapDocument = new ();
MapLocation String = "C: / dev / ArcObjects / Argo_Countries.mxd";
/ / Open mxd
if (mapDocument.isPresent (mapLocation)) {
mapDocument.open (mapLocation, "");

IMap mapDocument.getMap pmap = (0);
FeatureLayer pFeatureLayer = (FeatureLayer) pMap.getLayer (0);
String fieldName;
fieldName = uniqueValueRenderer.getField (0);
IFeatureClass featureClass pFeatureLayer.getFeatureClass = ();

It is this last line that I have a problem. I almost try anything so your help will be welcome

Thanking you