阅读:2019回复:4
关于AO的隐藏属性问题,COM能人来看看
<P>首先题目的提法不一定正确,如有错误大家指点。</P>
<P>下面把我的问题说一下,IFieldsEdit接口在帮助中说有AddField这个方法,但在vb中却找不到,</P> <P>但如果强行使用此方法,却可以运行通过,我使用ESRI OBJECT BROWER查看此接口时,</P> <P>发现使用类VB只有四个属性方法,而在as IDL 时却可以看到AddField这个方法,不过它是hidden</P> <P>隐藏的大家来解释一下为什么这样做呢,难到AddField这个方法不推荐在vb使用吗?还是有其他</P> <P>方面的顾虑。</P> |
|
1楼#
发布于:2005-05-12 09:45
<P>AddField Example
'This piece of code finds the index of the Field "SUBNAME", returns the Field at the index, 'and deletes the Field from the Fields collection Debug.Print pFields.FieldCount ; " in Fields collection before the Field SUBNAME is removed" 'Find and set the Field "SUBNAME" in the Fields collection Dim lIndex As Long Dim pField As IField pFields.FindField "SUBNAME", lIndex Set pField = pFields.Field(lIndex) 'Remove Field named "SUBNAME" from Fields collection Dim pFieldsEdit As IFieldsEdit Set pFieldsEdit = pFields pFieldsEdit.DeleteField pField Debug.Print pFields.FieldCount ; " in Fields collection after the Field SUBNAME is removed" 'This piece of code deletes all Fields from the Fields collection pFieldsEdit.DeleteAllFields Debug.Print pFields.FieldCount ; " in Fields collection after all Fields have been removed" 'This piece of code adds the Field "SUBNAME" to the empty Fields collection pFieldsEdit.AddField pField Debug.Print pFields.FieldCount ; " in Fields collection after the Field SUBNAME has been added" </P> [此贴子已经被作者于2005-5-12 9:47:16编辑过]
|
|
|
2楼#
发布于:2005-05-12 09:59
<P>GIS贴的代码我在Develope Help看到过了,且也运行通过,程序是没有问题的。</P><P>pFieldsEdit.AddField pField</P><P>我想搞清楚的是上面那句话pFieldsEdit在vb中是点不出AddField这个方法的。pFieldEdit在vb一共就</P><P>四个属性方法,没有AddField。但运行是没问题。</P>
|
|
3楼#
发布于:2005-05-12 13:04
有些开发工具里面有隐藏高级成员的选项的。去掉就可以在提示里看到了
|
|
4楼#
发布于:2005-05-12 15:45
<P>lameboy:</P><P>请问vb中怎么去掉?</P>
|
|