qiuwen777
路人甲
路人甲
  • 注册日期2005-01-17
  • 发帖数53
  • QQ
  • 铜币307枚
  • 威望0点
  • 贡献值0点
  • 银元0个
阅读:2019回复:4

关于AO的隐藏属性问题,COM能人来看看

楼主#
更多 发布于:2005-05-12 09:31
<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>
喜欢0 评分0
gis
gis
管理员
管理员
  • 注册日期2003-07-16
  • 发帖数15951
  • QQ
  • 铜币25345枚
  • 威望15368点
  • 贡献值0点
  • 银元0个
  • GIS帝国居民
  • 帝国沙发管家
  • GIS帝国明星
  • GIS帝国铁杆
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编辑过]
GIS麦田守望者,期待与您交流。
举报 回复(0) 喜欢(0)     评分
qiuwen777
路人甲
路人甲
  • 注册日期2005-01-17
  • 发帖数53
  • QQ
  • 铜币307枚
  • 威望0点
  • 贡献值0点
  • 银元0个
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>
举报 回复(0) 喜欢(0)     评分
LameBoy
路人甲
路人甲
  • 注册日期2004-06-30
  • 发帖数44
  • QQ
  • 铜币223枚
  • 威望0点
  • 贡献值0点
  • 银元0个
3楼#
发布于:2005-05-12 13:04
有些开发工具里面有隐藏高级成员的选项的。去掉就可以在提示里看到了
举报 回复(0) 喜欢(0)     评分
qiuwen777
路人甲
路人甲
  • 注册日期2005-01-17
  • 发帖数53
  • QQ
  • 铜币307枚
  • 威望0点
  • 贡献值0点
  • 银元0个
4楼#
发布于:2005-05-12 15:45
<P>lameboy:</P><P>请问vb中怎么去掉?</P>
举报 回复(0) 喜欢(0)     评分
游客

返回顶部