Visual Studio 2008如何查找事件处理程序 [英] Visual Studio 2008 How to find the Event Handler

查看:152
本文介绍了Visual Studio 2008如何查找事件处理程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我正在迁移VC6 - > VS2008使用MFC。

我花了几个小时来查找如何从菜单编辑器(在资源视图中)直接导航到特定子菜单项的事件功能。



在VC6上工作我是以下一种方式完成的(基于Dialog,MCF):

1.打开菜单编辑器

2。用左键单击选择任何菜单项

3. Ctrl + W(调用向导)

4.在出现的新对话框中,最右边的EditBox选择COMMAND

5.点击按钮编辑代码



我需要跳转到目标代码部分。

< br $>
VS2008(基于对话框,MFC):

1.打开菜单编辑器

2.用右键单击选择任何菜单项

3.上下文菜单>添加事件处理程序

4.在出现的对话框中:按钮添加并编辑和取消。

如果未创建处理程序,则添加和编辑处于活动状态。如果处理程序已经存在

,则只有取消处于活动状态。



来自msdn:

如果选中消息类型已具有所选类的事件处理程序,添加和编辑不可用,并且编辑代码可用。单击编辑代码以在现有功能中打开文本编辑器。



对话框中没有EditCode按钮。谷歌搜索没有任何结果,似乎没有人发现菜单信息有问题。



如何找到目标功能?

请做不建议查找>所有文件>文本:)

Hello ALL,

I am migrating VC6 -> VS2008 using MFC.
I've spent several hours to find how to navigate from the Menu Editor (in the Resource View) directly to the Event function for a certain submenu item.

Working on VC6 I did it in the next manner (Dialog based, MCF):
1. Open Menu Editor
2. Select any menu item with the left button click
3. Ctrl+W (call Wizard)
4. In the appeared new dialog, rightmost EditBox select COMMAND
5. Click button Edit Code

It is all I need to "jump" to the target code part.

VS2008 (Dialog based, MFC):
1. Open Menu Editor
2. Select any menu item with the right button click
3. Context Menu > Add Event Handler
4. In the appeared dialog: buttons "Add and Edit" and "Cancel".
Add and Edit is active if a handler is not created. If handler already
present, only "Cancel" is active.

From msdn:
If the selected message type already has an event handler for the selected class, Add and edit is unavailable, and Edit code is available. Click Edit Code to open the text editor at the existing function.

There are no EditCode buttons in the dialog. Googling got nothing, its appears that nobody had problems with the menu message finding.

How can I find the target function?
Please do not suggest Find>All files>text :)

推荐答案

引用:

请不建议查找>所有文件>文本

Please do not suggest Find>All files>text



为什么不呢? ...那将为您提供所需的事件处理程序。至于为什么它在Visual Studio中被破坏了......可能是因为处理程序没有合适的原型。 Visual Studio 6从未检查原型以确保它们与应该存在的原型匹配.... Visual Studio 2008期望原型与您正在进行的操作相匹配。


Why not? ...that'll get you the event handler you need. As to why it's broken in Visual Studio... it's probably because the handler doesn't have the appropriate prototype. Visual Studio 6 never checked the prototypes to make sure they matched what was supposed to be there.... Visual Studio 2008 expects the prototypes to match what you're doing.


您好,



假设我有菜单:

MyMenu

--- subitem1



假设我们有文件和文本的深度:

void CSomeDlg :: OnMenuMyMenusubitem1()

{

...

}



有没有办法在一两次点击中找到这个OnMenuMyMenusubitem1()?

古老的VC6似乎比现代玩具具有更多的功能...
Hi,

assume I have menu:
MyMenu
---subitem1

Assume somewhere in depth of files and texts we have:
void CSomeDlg::OnMenuMyMenusubitem1()
{
...
}

Is there a way to find this "OnMenuMyMenusubitem1()" in one-two clicks?
The ancient VC6 seems to have more functionality than modern toys...


这篇关于Visual Studio 2008如何查找事件处理程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆