阅读:1456回复:1
mo2.3有bug么?
<P>试用mo2.3(已破解)</P>
<P>载入了一个帮助文件里的例子,代码如下</P> <P>Option Explicit</P> <P>Private Sub Command1_Click()<br> Dim strFileTitle As String, sDataSetName As String<br> Dim sFileDirectory As String<br> Dim dc As New MapObjects2.DataConnection<br> Dim lyr As New MapObjects2.MapLayer<br> <br> CommonDialog1.Filter = "Shapefiles (*.shp)|*.shp"<br> CommonDialog1.ShowOpen<br> <br> strFileTitle = CommonDialog1.FileTitle 'just the name with the shp extension<br> <br> If strFileTitle <> "" Then<br> <br> With CommonDialog1<br> sFileDirectory = Left$(.FileName, InStr(.FileName, .FileTitle) - 1)</P> <P> End With<br> <br> With dc<br> .Database = sFileDirectory 'the directory containing the selected file<br> <br> If .Connect Then<br> sDataSetName = Mid(strFileTitle, 1, Len(strFileTitle) - 4) 'remove the extension<br> Set lyr.GeoDataset = dc.FindGeoDataset(sDataSetName)<br> Map1.Layers.Add lyr<br> Else<br> MsgBox "Data Connection error #" ; dc.ConnectError, vbExclamation<br> End If<br> End With<br> <br> End If<br> <br> Set dc = Nothing</P> <P> Set lyr = Nothing</P> <P>End Sub</P> <P>运行时发现,如果把shape文件放在某个目录下,会出现错误"valid object expected as argument",只有放在根目录下才能正确载入,这个问题怎么解决呢?</P> <P><img src="images/post/smile/dvbbs/em28.gif" /><img src="images/post/smile/dvbbs/em30.gif" /></P> [此贴子已经被作者于2005-10-17 12:21:48编辑过]
|
|
1楼#
发布于:2005-11-07 10:39
不要用中文名看看能行否
|
|
|