Hello,Does anyone know why the following code crashes ArcMap v10? if you attempt to view Data Frame properties after running it - bupbow!But it works perfect in v9.3.1also - is there a way of getting around it? I need this functionality to migrate our Production environment to v10.Many thanks,-nav.
public override void OnClick()
{
IApplication application = m_hookHelper.Hook as IApplication;
IMxDocument mxdDoc = application.Document as IMxDocument;
IMap map = mxdDoc.ActiveView.FocusMap;
IGraphicsContainer graphicsContainer = mxdDoc.PageLayout as IGraphicsContainer;
IFrameElement frameElement = graphicsContainer.FindFrame(map);
IMapFrame mapFrame = frameElement as IMapFrame;
// this line crashes in ArcGIS v10
mapFrame.ExtentType = esriExtentTypeEnum.esriExtentBounds;
// this line also crashes in ArcGIS v10
//mapFrame.ExtentType = esriExtentTypeEnum.esriAutoExtentBounds;
}