我用VS2005 C# + MapX5.0开发,MapX5.0控件在.COM组件中能见到,而且也可以使用放大缩小等等,但是我要自己新建一个图层集和图层类,比如报错 “检索 COM 类工厂中 CLSID 为 {77306D43-5C82-11CF-8795-00AA00B7EF73} 的组件时失败,原因是出现以下错误: 80040154。”不知道怎么解决?我把 MapX50.dll放到system32里了也没用。代码如下,这里的全图浏览都可以用
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using AxMapXLib;
using MapXLib;namespace Csharp_MapXTest1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
} private void Form1_Load(object sender, EventArgs e)
{
LayerInfo lyrsInfo = new LayerInfo();
Layers lyrs = new Layers(); ////////////////////这里报错……无语了
} private void button1_Click(object sender, EventArgs e)
{
MapXLib.Map map = axMap1.GetOcx() as MapXLib.Map; // 全图浏览
if (map != null)
{
map.Bounds = axMap1.Layers.Bounds;
}
} }
}
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using AxMapXLib;
using MapXLib;namespace Csharp_MapXTest1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
} private void Form1_Load(object sender, EventArgs e)
{
LayerInfo lyrsInfo = new LayerInfo();
Layers lyrs = new Layers(); ////////////////////这里报错……无语了
} private void button1_Click(object sender, EventArgs e)
{
MapXLib.Map map = axMap1.GetOcx() as MapXLib.Map; // 全图浏览
if (map != null)
{
map.Bounds = axMap1.Layers.Bounds;
}
} }
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货