.net环境下扩展arcmap组件

koala611 2010-03-29 05:03:56
我想在.net下编写arcmap的组件,编写了一个类库,里面主要是继承icommand的一个类,还有一段#region包起来的注册函数,其实代码大多是从参考书上照搬下来的。我的com interop 也勾上了。但是运行时就没什么反应,arcmap上也找不到那个工具,设断点也没停,各位高手可以讲解一下为什么吗?最好解释下原理,小弟是菜鸟,谢了
#region Component Categeory Registration
[ComRegisterFunction()]
[ComVisible(true)]
static void ComRegisterFunction(string skey)
{
string fullKey = skey.Remove(0, 18) + @"Implemented Categories";

Microsoft.Win32.RegistryKey regkey = Microsoft.Win32.Registry.ClassesRoot.OpenSubKey(fullKey, true);
if (regkey != null)
{
regkey.CreateSubKey("{38C1D029-3A0C-41D4-A208-5CDA91F5E41D}");
}
}
[ComUnregisterFunction()]
[ComVisible(true)]
static void UncomregisterFunction(string skey)
{
string fullKey = skey.Remove(0, 18) + @"Implemented Categories";
Microsoft.Win32.RegistryKey regkey = Microsoft.Win32.Registry.ClassesRoot.OpenSubKey(fullKey, true);
if (regkey != null)
{
regkey.DeleteSubKey("{38C1D029-3A0C-41D4-A208-5CDA91F5E41D}");
}
}
#endregion
...全文
50 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

110,533

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧