zhezhe0113
路人甲
路人甲
  • 注册日期2004-04-11
  • 发帖数37
  • QQ
  • 铜币248枚
  • 威望0点
  • 贡献值0点
  • 银元0个
阅读:1259回复:1

请教一个问题,几天来夜不能寐!!

楼主#
更多 发布于:2004-11-10 12:56
<P>我用C#定制AO的时候,发现IMenuDef,IToolBarDef做出的无论是菜单还是工具条都出不来,程序都检查了几百次了,应该没有错误。请哪位大虾帮忙了</P>
<P>using System;
using System.Drawing;
using System.Runtime.InteropServices;
using ESRI.ArcObjects.Core;</P>
<P>
namespace fuzhubianzhi
{
 /// <summary>
 /// zongtitool 的摘要说明。
 /// </summary>
 /// </P>
<P> [ClassInterface(ClassInterfaceType.None)]</P>
<P> [Guid("1BFB2A1E-2B2C-4359-94C5-0C131F60929D")]</P>
<P>
 public class zongtitool : IToolBarDef
 {</P>
<P>
  #region Component Category Registration</P>
<P>  [ComRegisterFunction]</P>
<P>  [ComVisible(false)]</P>
<P>  public static void RegisterFunction(Type t)</P>
<P>  {</P>
<P>   string sKey = @"\CLSID\{" + t.GUID.ToString() + @"}\Implemented Categories";</P>
<P>   Microsoft.Win32.RegistryKey regKey
    = Microsoft.Win32.Registry.ClassesRoot
    .OpenSubKey(sKey, true);</P>
<P>   if (regKey != null)</P>
<P>   {</P>
<P>    regKey.CreateSubKey("{B56A7C42-83D4-11D2-A2E9-080009B6F22B}");</P>
<P>   }</P>
<P>  }</P>
<P>   </P>
<P>  [ComUnregisterFunction]</P>
<P>  [ComVisible(false)]</P>
<P>  public static void UnregisterFunction(Type t)</P>
<P>  {</P>
<P>   string sKey = @"\CLSID\{" + t.GUID.ToString() + @"}\Implemented Categories";</P>
<P>   Microsoft.Win32.RegistryKey regKey
    = Microsoft.Win32.Registry.ClassesRoot
    .OpenSubKey(sKey, true);</P>
<P>   if (regKey != null)</P>
<P>   {</P>
<P>    regKey.DeleteSubKey("{B56A7C42-83D4-11D2-A2E9-080009B6F22B}");</P>
<P>   }</P>
<P>  }</P>
<P>  #endregion</P>

<P>  public zongtitool()
  {
   //
   // TOD 在此处添加构造函数逻辑
   //
  }
  #region IToolBarDef 成员</P>
<P>  public void GetItemInfo(int pos, IItemDef itemDef)
  {
   // TOD  添加 zongtitool.GetItemInfo 实现</P>
<P>   switch(pos)
   {
    case 0 :
     itemDef.ID = "fuzhubianzhi.zongTiEditor";
     itemDef.Group = false;
     break;
    default :
     break;
//    case 1:
//     itemDef.ID = "ESRI.ArcObjects.Samples.CatIDs.GxFeatureDatasetExportMenuCommand";
//     itemDef.Group = false;
//     break;
   }
  }</P>
<P>  public string Caption
  {
   get
   {
    // TOD  添加 zongtitool.Caption getter 实现
    return "zongtitools";
   }
  }</P>
<P>  public string Name
  {
   get
   {
    // TOD  添加 zongtitool.Name getter 实现
    return "zongtitools";
   }
  }</P>
<P>  public int ItemCount
  {
   get
   {
    // TOD  添加 zongtitool.ItemCount getter 实现
    return 1;
   }
  }</P>
<P>  #endregion
 }
}
</P>
喜欢0 评分0
kendomen
路人甲
路人甲
  • 注册日期2004-10-18
  • 发帖数13
  • QQ
  • 铜币163枚
  • 威望0点
  • 贡献值0点
  • 银元0个
1楼#
发布于:2004-11-29 10:46
B56A7C42-83D4-11D2-A2E9-080009B6F22B--------有错
举报 回复(0) 喜欢(0)     评分
游客

返回顶部