阅读:2246回复:4
请教IMapControl3.AddShapeFile 问题
<P>请教各位高手:</P>
<P> 我的shapefile文件存放路径为 D:\data\myshapefile.shp</P> <P> 相关代码如下:</P> <P> IMapControl3 m_mapControl=null;</P> <P> <STRONG> m_mapControl.AddShapeFile(@"D:\data","myshapefile.shp");</STRONG><BR>编译时没有错误,但在运行代码时抛出异常:COMException was unhandle,异常内容是:Exception from HRESULT:0x800A041E </P> <P> 根据帮助文件知: 0x800A041E,The specifield filename is invaslid. 但程序中,我的 filename 并没有错误,确实是myshapefile.shp。请高手指点!谢谢! </P> |
|
1楼#
发布于:2007-09-17 17:09
<DIV class=quote><B>以下是引用<I>enjoylives</I>在2007-9-14 18:38:39的发言:</B><BR>
<P>请教下,怎么由帮助文档知道0x800A041E代表的异常是The specifield filename is invaslid呢</P></DIV> <br>直接查看<STRONG>AddShapeFile</STRONG>方法的帮助文档! |
|
2楼#
发布于:2007-09-14 18:38
<P>请教下,怎么由帮助文档知道0x800A041E代表的异常是The specifield filename is invaslid呢</P>
|
|
3楼#
发布于:2007-09-13 09:31
<P>问题已解决,谢谢各位的关注!</P>
<P>需要把 myshapfile.dbf myshapfile.shp mashapfile.shx 三个文件放在 mypath文件夹下!</P> <P>呵呵,偶是新手,因为这个问题耽误了两天了。。。</P> |
|
4楼#
发布于:2007-09-12 16:32
路径错误了,可能是分隔符的原因,addshapefile ("c:\test\","myshapefile.shp");<BR>
|
|
|