Invalid Class Typecast

I keep getting the message "Invalid Class Typecast" with no additional
info. How do I determine what Class the message refers to? The message
just pops up at odd times and then I can't save my project or exit
Delphi. Thanks