I'm porting some code to Delphi XE and noticed that if I use Application.Handle to get the handle of the program, 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 importsForms
and so theApplication
variable inSvcMgr
takes the one that you want inForms
out of scope. Or perhaps the culprit isWebBroker
orCtlPanel
.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'tForms
.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!