各位大牛,我是ARcGisEngine 新手,求帮助
小弟刚刚接触AE开发,在学习 图层符号选择器的实现 时遇到一个问题,如图。附代码
--------------------编程问答-------------------- 现在报异常了。。。。
private void axTOCControl1_OnDoubleClick(object sender, ITOCControlEvents_OnDoubleClickEvent e)
{
esriTOCControlItem toccItem = esriTOCControlItem.esriTOCControlItemNone;
ILayer iLayer = null;
IBasicMap iBasicMap = null;
object unk = null;
object data = null;
if (e.button == 1)
{
axTOCControl1.HitTest(e.x, e.y, ref toccItem, ref iBasicMap, ref iLayer, ref unk,
ref data);
System.Drawing.Point pos = new System.Drawing.Point(e.x, e.y);
if (toccItem == esriTOCControlItem.esriTOCControlItemLegendClass)
{
ESRI.ArcGIS.Carto.ILegendClass pLC = new LegendClassClass();
ESRI.ArcGIS.Carto.ILegendGroup pLG = new LegendGroupClass();
if (unk is ILegendGroup)
{
pLG = (ILegendGroup)unk;
}
pLC = pLG.get_Class((int)data);
ISymbol pSym;
pSym = pLC.Symbol;
ESRI.ArcGIS.DisplayUI.ISymbolSelector pSS = new ESRI.ArcGIS.DisplayUI.SymbolSelectorClass();
bool bOK = false;
pSS.AddSymbol(pSym);
bOK = pSS.SelectSymbol(0);
if (bOK)
{
pLC.Symbol = pSS.GetSymbolAt(0);
}
this.axMapControl1.ActiveView.Refresh();
this.axTOCControl1.Refresh();
}
}
}
检索 COM 类工厂中 CLSID 为 {D20B08DF-4FF4-11D2-AB02-00C04FA334B3} 的组件失败,原因是出现以下错误: 80040111 ClassFactory 无法供应请求的类 (异常来自 HRESULT:0x80040111 (CLASS_E_CLASSNOTAVAILABLE))。
求各位大牛指点
开发环境是ArcGisEngine 10.0+VS2010
语言是C# --------------------编程问答-------------------- 问题解决了:
Program.cs中将ESRI.ArcGIS.RuntimeManager.Bind(ESRI.ArcGIS.ProductCode.EngineOrDesktop);改为ESRI.ArcGIS.RuntimeManager.Bind(ESRI.ArcGIS.ProductCode.Desktop); --------------------编程问答-------------------- 非常感谢,解决我的问题了 --------------------编程问答--------------------
是的,之前也遇到类似的问题,也通过这个办法解决了。多谢楼主共享。 --------------------编程问答-------------------- 除
补充:企业软件 , 地理信息系统