MapObjects2.4 出现问题 “未处理COMException” Valid object expected as argument.
private AxMapObjects2.AxMap axMap1;
private void map_Load(object sender, EventArgs e)
{
this.Location = new Point(210, 80);
MapObjects2.DataConnection dc = new MapObjects2 .DataConnectionClass();
//定义图层
MapObjects2.MapLayer layer = new MapObjects2.MapLayerClass();
dc.Database = "" + Application.StartupPath + "";
if (!dc.Connect())//连接不成功就退出
{
MessageBox.Show("在指定的文件夹下没找到图层数据文件");
Application.Exit();
}
else//连接成功了就加载地图
{
//加载图层States,
layer.GeoDataset = dc.FindGeoDataset("mas1.bmp"); <--错误指向这句
axMap1.Layers.Add(layer);
}
axMap1.Refresh();
}
高手请 帮忙,谢谢!
------解决方案--------------------这什么东西?没用过..
------解决方案--------------------
你要加载图片有专门的ImageLayer
Dim pImgLyr as New MapObjects2.ImageLayer
pImgLyr.File = "C:\Data\MyBitmap.bmp"
你要用dc.FindGeoDataset()的话里面应该是*.shp文件,具体看MO的帮助文档
------解决方案--------------------
你有MO软件吗?能给我发个吗?万分感谢
信箱是:jixingjie2004@yahoo.com.cn