wanhu128
路人甲
路人甲
  • 注册日期2005-08-09
  • 发帖数71
  • QQ
  • 铜币447枚
  • 威望0点
  • 贡献值0点
  • 银元0个
阅读:1560回复:4

IEditor接口求助

楼主#
更多 发布于:2005-08-12 11:30
IApplication pApp;<BR>   IEditor pEditor;<BR>  <FONT color=#ff3300> pApp = new AppRefClass();</FONT><BR>   pEditor = (IEditor)pApp.FindExtensionByName("ESRI Object Editor");<BR>红色这句话有灾难性的错误。请问在C#中得到给Ieditor接口赋值
喜欢0 评分0
gis
gis
管理员
管理员
  • 注册日期2003-07-16
  • 发帖数15951
  • QQ
  • 铜币25345枚
  • 威望15368点
  • 贡献值0点
  • 银元0个
  • GIS帝国居民
  • 帝国沙发管家
  • GIS帝国明星
  • GIS帝国铁杆
1楼#
发布于:2005-08-13 10:43
<P>下面是帮助里的例子,你的错误是什么?</P>
<P>In VBA, the Application object is globally available. <BR></P><PRE><CODE>  Dim pEditor As IEditor
  Dim pID As New UID

  pID = "esriEditor.Editor"
  Set pEditor = Application.FindExtensionByCLSID(pID)
</CODE></PRE>
<P><BR>With Visual Basic you are working outside of the application and you therefore need to establish a hook to it. When implementing<B> ICommand</B> to create a command or tool, a hook to the application is passed to <B>OnCreate</B> </P><PRE><CODE> Private m_pApp as IApplication
 Private m_pEditor as IEditor

 Private Sub ICommand_OnCreate(ByVal hook As Object)
   Dim pID As New UID

   pID = "esriEditor.Editor"
   Set m_pApp = hook
   Set m_pEditor = m_pApp.FindExtensionByCLSID(pID)
 End Sub
</CODE></PRE>
GIS麦田守望者,期待与您交流。
举报 回复(0) 喜欢(0)     评分
wanhu128
路人甲
路人甲
  • 注册日期2005-08-09
  • 发帖数71
  • QQ
  • 铜币447枚
  • 威望0点
  • 贡献值0点
  • 银元0个
2楼#
发布于:2005-08-15 10:44
hook我们在C#中怎么得到啊
举报 回复(0) 喜欢(0)     评分
wanhu128
路人甲
路人甲
  • 注册日期2005-08-09
  • 发帖数71
  • QQ
  • 铜币447枚
  • 威望0点
  • 贡献值0点
  • 银元0个
3楼#
发布于:2005-08-15 10:45
<P>其实我最大的问题还是在C#中怎么给m_pApp赋值</P>
举报 回复(0) 喜欢(0)     评分
wanhu128
路人甲
路人甲
  • 注册日期2005-08-09
  • 发帖数71
  • QQ
  • 铜币447枚
  • 威望0点
  • 贡献值0点
  • 银元0个
4楼#
发布于:2005-08-22 12:20
<P>我怎么样把他翻译为C#的</P>
举报 回复(0) 喜欢(0)     评分
游客

返回顶部