|
阅读:1560回复:4
IEditor接口求助
IApplication pApp;<BR> IEditor pEditor;<BR> <FONT color=#ff3300> pApp = new AppRefClass();</FONT><BR> pEditor = (IEditor)pApp.FindExtensionByName("ESRI Object Editor");<BR>红色这句话有灾难性的错误。请问在C#中得到给Ieditor接口赋值
|
|
|
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> |
|
|
|
2楼#
发布于:2005-08-15 10:44
hook我们在C#中怎么得到啊
|
|
|
3楼#
发布于:2005-08-15 10:45
<P>其实我最大的问题还是在C#中怎么给m_pApp赋值</P>
|
|
|
4楼#
发布于:2005-08-22 12:20
<P>我怎么样把他翻译为C#的</P>
|
|