Using Delphi XE5 I'd like to use Application variable (TApplication type) in other unit's class. If I try to pass it with var or out parameter and then use it - I get Access Violation error. Is there a way to get data from Application in shared .pas library?
for TempComponent in Application.MainForm do
if (TempComponent is TTextControl) then
ShowMessage('Text Assigned : ' + TempComponent.Name)
else
ShowMessage('No TTextControl Descendant : ' + TempComponent.Name);
I have included FMX.Forms in every unit. The above code works in main form class procedures, but when I use it in other unit I get AV in running application.