tim11g
tim11g

Reputation: 1983

Calling "application.processmessages" from unit - "application" is undeclared

I'm using Delphi 7. I'm trying to add a procedure with a call to "application.processmessages" in a non-VCL unit. I get the error "undeclared identifier: application".

How do I reference the TApplication class from a non-vcl unit? Where in the documentation is this described? It is hard to find due to the broad use of the term "application".

Upvotes: 1

Views: 15468

Answers (2)

Jon Benedicto
Jon Benedicto

Reputation: 10582

Add Forms to the uses clause of your unit. Eg:

uses Forms;

Upvotes: 18

Henk Holterman
Henk Holterman

Reputation: 273244

Well, if you do it then your unit becomes a VCL (-dependent) unit, are you sure that's the right way to go?

Application is a global variable in the Forms unit.

Upvotes: 5

Related Questions