Well, it looks like you are using ObjectWindows, so that automatically means you MUST use a Borland C++ compiler. (I think ObjectWindows is to Borland as MFC is to Microsoft

) They seem pretty equivalent anyhow.
Secondly, I would have to see the class definition of TGPLightsForm in order to know what you are trying to do. I mean, are things such as "Switch" and "State" members of class TGPLightsForm??? ....and if they're not, are those global variables??? ....and if they are global variables,......WHY???? There are good uses for global variables, but that doesn't look like one of them
Also, what is in ABC3Q1U.h ???
What does #pragma package(smart_init) do, and what does #pragma resource "*.dfm" do???
#pragmas are always known to be compiler-specific instructions (actually for the preprocessor), so that makes your code compiler-specific anyway (which it already was, as you are using ObjectWindows)
Without that information, I don't think anyone could help you.