托管 C 中的事件:事件、WindowEvents 问题
使用托管 C++(新建项目向导中的 C++/CLR)开发 VisStudio 2008 插件。
在 OnConnection() 函数中,我想向 WindowEvents 集合添加一个处理程序。
当我这样做时:
// 连接事件
EnvDTE::Events ^ events = _applicationObject->Events;
EnvDTE::WindowEvents ^winEvents = events->WindowEvents();
我收到一条错误消息:
错误 C2660: 'EnvDTE::Events::WindowEvents::get' : 函数不接受 0 个参数
在对象浏览器中我找到了这个:
公共 EnvDTE.WindowEvents WindowEvents(EnvDTE.Window WindowFilter = null) { get; 感谢
您对我做错了什么的任何提示......
Working on a VisStudio 2008 addin, using managed C++ (C++/CLR in the New Project wizard).
In the OnConnection() function, I want to add a handler to the WindowEvents collection.
When I do this:
// Hook up events
EnvDTE::Events ^ events = _applicationObject->Events;
EnvDTE::WindowEvents ^winEvents = events->WindowEvents();
I get an error message:
error C2660: 'EnvDTE::Events::WindowEvents::get' : function does not take 0 arguments
In the Object Browser I find this:
public EnvDTE.WindowEvents WindowEvents(EnvDTE.Window WindowFilter = null) { get; }
Thanks for any hints about what I'm doing wrong...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试
不使用 ()。 WindowEvents 是一个属性而不是方法。
Try
without the (). WindowEvents is a property not a method.
找到答案:
注意方括号......
Found the answer:
Note the square brackets...