代码完成不列出消息处理程序 [英] Code-completion doesn't list message handlers

查看:95
本文介绍了代码完成不列出消息处理程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Delphi XE2中处理旧项目时,在 CTRL - SPACE 之后弹出的代码完成窗口没有像Delphi 7那样列出消息处理程序: / p>



在上面的屏幕快照中,缺少 WM *** 例程。为什么?

解决方案

uses子句中的单元名称不完全限定。包括每个单元的名称空间,然后找到方法声明的必要类型,以使代码完成弹出窗口返回所有成员。



例如:




  • 过程WMActivate(var Message:TWMActivate); 在<$找不到c $ c> Winapi.Messages.TWMActivate

  • 程序CMActivate(var Message:TCMActivate); Vcl.Controls.TCMActivate 时,不会显示c $ c>。



解决方案:

 使用
Winapi.Windows,Winapi.Messages,System.Classes,Vcl。控件,Vcl.Forms,
Vcl.Graphics;



确切的原因,我不敢解释。特别是因为所有其他方法(不是消息处理程序)都会显示出相关单元是否完全合格。但这并不重要;在Delphi 2009或更高版本中工作时,您应该习惯于使用完全合格的单位名称。


When working on an old project in Delphi XE2, the code-completion window that pops up after CTRL-SPACE does not list message handlers like Delphi 7 did:

In the screen shot above, the WM*** routines are missing. Why is that?

解决方案

The unit names in the uses clause are not fully qualified. Include the namespace for each unit and then the necessary types for the method declarations are found to let the code-completion pop-up window return all members.

For instance:

  • procedure WMActivate(var Message: TWMActivate); will not be shown when Winapi.Messages.TWMActivate isn't found,
  • procedure CMActivate(var Message: TCMActivate); will not be shown when Vcl.Controls.TCMActivate isn't found.

Solution:

uses
  Winapi.Windows, Winapi.Messages, System.Classes, Vcl.Controls, Vcl.Forms,
  Vcl.Graphics;

Exactly why this is, I do not dare to explain. Especially since all other methods (not being message handlers) are shown whether the concerning unit is fully qualified or not. But it does not really matter; when working in Delphi 2009 or above, you should get accustomed to use fully qualified unit names nevertheless.

这篇关于代码完成不列出消息处理程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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