编程 Visual Studio 宏
我在尝试为 Visual Studio 编写宏时感到沮丧(使用 VS 2008,版本 9.0.30729.1 SP,包含所有更新)。
在宏资源管理器中,我可以转到 Microsoft 的示例/VSEditor 并添加一个按照我的意愿运行的子例程。 但我似乎无法让它在其他地方工作。 特别是在宏资源管理器的 MyMacros 区域中。
详情:
我已复制整个示例/VSEditor 代码并将其复制到 MyMacros/Testing 并将内部模块名称重命名为测试并保存修改后的代码。 宏资源管理器现在显示测试模块及其包含的所有子例程。 如果我右键单击“InsertDate”并选择“运行”,则不会发生任何情况。 但是,如果我向下滚动到示例/VSEditor/InsertDate 并右键单击并选择“运行”,它将按照预期插入日期。 它实际上是相同的代码(只是上面提到的位置和名称发生了变化),但一个运行而另一个不运行。
有没有办法获得有关正在发生的事情/代码失败的地方/代码失败的原因的反馈?
谁能解释我做错了什么?
I am frustrated trying to program macros for Visual Studio (using VS 2008, Version 9.0.30729.1 SP, with all updates).
In the Macro Explorer, I can go to Microsoft's samples/VSEditor and add a Subroutine that behaves as I desire. But I can't seem to make it work anywhere else. In particular, in the MyMacros area in Macro Explorer.
Details:
I have copied the entire samples/VSEditor code and copied it to MyMacros/Testing and renamed the internal module name to Testing and saved the modified code. Macro Explorer now shows the Testing module and all of the Subroutines it contains. If I right click on, say, InsertDate and select Run, nothing happens. But if I scroll down to the samples/VSEditor/InsertDate and right click and select Run, it inserts the date as one would expect. It is virtually identical code (just the location and name changes mentioned above) but one runs and the other doesn't.
Is there any way to obtain feedback on what is happening/where the code is failing/why the code is failing?
Can anyone explain what I am doing wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我尝试了同样的操作,将 VSEditor 代码复制到 MyMacros/Testing。 事情也不会进行。
然后我转到菜单选项查看|错误列表。 然后转到Microsoft Visual Studio Macros 编辑器中的菜单选项调试|构建。 我发现实用程序未声明(错误列表中的第一个错误)。 当我将实用程序复制到 MyMacros 时。 宏开始起作用。
也许这与您遇到的问题相同。
I tried the same thing, copied VSEditor code to MyMacros/Testing. Things would not run either.
I then went to the menu option View|Error List. Then to the menu option Debug|Build in the Microsoft Visual Studio Macros editor. I saw that the Utilities was not declared (first error in the error list). When I copied the Utilities over to MyMacros. The macros started to work.
Maybe this is the same problem you are having.