开发者

What happened to Application.handle in Delphi XE?

I'm porting some code to Delphi XE and noticed that if I use Application.Handle to get the handle of the progr开发者_如何学Goam, Delphi throws me an error and refuses to compile, saying:

Undeclared identifier: 'Handle'

This same behavior happens when I try to call Application.ProcessMessages. I figure something must have gotten shifted around that wasn't listed in the Unicode Migration guide.

Where did the functions and variables for 'Application' go?


My psychic debugging powers tell me that this unit imports SvcMgr after it imports Forms and so the Application variable in SvcMgr takes the one that you want in Forms out of scope. Or perhaps the culprit is WebBroker or CtlPanel.

You can work out which it is by CTRL clicking on the Application variable at the point of the first error and you'll land in a unit that isn't Forms.

The solution is just to reorder your imports so that Forms comes in after the others.

On the other hand, my psychic debugging powers could be broken today!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜