//---------------------------------------------------------------------------
/*
Remote Train Control Program for Windows

(c) Copyright 2015 by Mark DiVecchio

    This file is part of Remote Train Control.

    Remote Train Control is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Remote Train Control is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Remote Train Control.  If not, see <http://www.gnu.org/licenses/>.

*/
//---------------------------------------------------------------------------
#include <vcl.h>
#include <tchar.h>
#pragma hdrstop
//---------------------------------------------------------------------------
//Differences between BCB4.0/BCB6.0 and CB10.1


//
USEFORM("Route_Scene.cpp", RouteScene);
USEFORM("Route_Scene_Help.cpp", RTCRSHelp);
USEFORM("Op_Control.cpp", Op);
USEFORM("Quick_Controls.cpp", QuickCtrl);
USEFORM("Prog_Control.cpp", Program_Control);
USEFORM("RTC_Help.cpp", RTCHelp);
USEFORM("Train_Control.cpp", MainForm);
USEFORM("Track_Signal.cpp", TrackSignal);
USEFORM("Volume_Control.cpp", Volume);
USEFORM("Utility.cpp", Utilities);
USEFORM("Setup_Control.cpp", Setup);
USEFORM("RTC_Info.cpp", Splash);
USEFORM("TMCC_Control.cpp", TMCCOp);
USEFORM("Super_TIU_Mode.cpp", SuperTIU);
USEFORM("Debug_Controls.cpp", DB);
USEFORM("DCS_Setup_Controls.cpp", DCS_Setup);
USEFORM("Conv_Mode.cpp", ConvMode);
USEFORM("DetectedTags.cpp", DetectedRFIDTags);
USEFORM("Aspect.cpp", Aspects);
USEFORM("AIU_Control.cpp", AIUControl);
USEFORM("Command_Query.cpp", Command_Query_Form);
USEFORM("BlockName_Query.cpp", BlockNameQuery);
USEFORM("Engine_Commands.cpp", EngineCommands);
USEFORM("Layout.cpp", LayoutForm);
USEFORM("Num_Query.cpp", NumberQuery);
USEFORM("Message_Popup.cpp", MessagePopup);
USEFORM("Engine_Status.cpp", EngineStatus);
USEFORM("Engine_Info.cpp", EngineInfo);
USEFORM("LashUp_Selection.cpp", LashUp);
USEFORM("Hot_Com.cpp", Hot_Command);
USEFORM("DDQuery.cpp", DropDownQuery);
USEUNIT("PBFileThread.cpp");
USEUNIT("Engine_Information_Thread.cpp");
USEUNIT("Route_Scene_Thread.cpp");
USEUNIT("Comm_Thread.cpp");
USEUNIT("Tserial_event.cpp");
USEUNIT("Track_Signal_Thread.cpp");
USEUNIT("Message_Thread.cpp");
USEUNIT("Delay_Win_Msg.cpp");
USEUNIT("PC_Thread.cpp");
USEUNIT("DL_Thread.cpp");
USEUNIT("Engine_Status_Thread.cpp");
USEUNIT("Timer_Thread.cpp");
USEUNIT("mDNSThread.cpp");
USEUNIT("mDNSServices.cpp");
USEFORM("EngineListPopOut.cpp", PopOutEngineList);
USEFORM("TIUSetup.cpp", ActiveTIU);
USERC("Remote_Control.rc");
USEFORM("WatchdogSignal.cpp", Watchdog);
USEFORM("RouteScenePopoutList.cpp", PopoutRouteSceneList);
USEUNIT("Watchdog_Thread.cpp");
USEFORM("LashUpListPopOut.cpp", PopOutLashUpList);
//---------------------------------------------------------------------------
int WINAPI _tWinMain(HINSTANCE, HINSTANCE, LPTSTR, int)
{
	try
	{
        Application->Initialize();
        Application->Title = "Remote Train Control";
        Application->CreateForm(__classid(TMainForm), &MainForm);
         Application->CreateForm(__classid(TDB), &DB);
         Application->CreateForm(__classid(TNumberQuery), &NumberQuery);
         Application->CreateForm(__classid(TCommand_Query_Form), &Command_Query_Form);
         Application->CreateForm(__classid(TDetectedRFIDTags), &DetectedRFIDTags);
         Application->CreateForm(__classid(TBlockNameQuery), &BlockNameQuery);
         Application->CreateForm(__classid(TPopOutEngineList), &PopOutEngineList);
         Application->CreateForm(__classid(TLashUp), &LashUp);
         Application->CreateForm(__classid(TRouteScene), &RouteScene);
         Application->CreateForm(__classid(TPopoutRouteSceneList), &PopoutRouteSceneList);
         Application->CreateForm(__classid(TPopOutLashUpList), &PopOutLashUpList);
         Application->CreateForm(__classid(TDropDownQuery), &DropDownQuery);
         Application->Run();
	}
	catch (Exception &exception)
	{
		Application->ShowException(&exception);
	}
    catch (...)
    {
        try
        {
            throw Exception("");
        }
        catch (Exception &exception)
        {
            Application->ShowException(&exception);
        }
    }
	return 0;
}
//---------------------------------------------------------------------------
