CtrlMstr/CtrlMstr.cpp
2021-09-12 22:02:01 +02:00

41 lines
1.2 KiB
C++

//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
USERES("CtrlMstr.res");
USEFORM("CtrlPPal.cpp", CtrlPPal);
USEFORM("TStatus.cpp", Status);
USEUNIT("CtrlSocket.cpp");
USEFORM("CtrlCfg.cpp", ElementosCFG);
USEUNIT("CtrlElemento.cpp");
USEFORM("FichasClientes.cpp", FClientes);
USEFORM("FormularioREUSABLE.cpp", FormREUSABLE);
USEFORM("ComprarBono.cpp", CBono);
//---------------------------------------------------------------------------
WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
{
AnsiString FsMutex = DateToStr(TDateTime::CurrentDate()) + AnsiString("-mutex-ctrlmstr");
HANDLE FhMutex = OpenMutex(MUTEX_ALL_ACCESS,False, FsMutex.c_str() );
if ( FhMutex == 0 ) //it's a first instance
{
FhMutex = CreateMutex(NULL,false, FsMutex.c_str() );
try
{
Application->Initialize();
Application->Title = "Control Maestro";
Application->CreateForm(__classid(TCtrlPPal), &CtrlPPal);
Application->Run();
}
catch (Exception &exception)
{
Application->ShowException(&exception);
}
} else {
if ( CloseHandle(FhMutex) ) FhMutex = 0;
}
return 0;
}
//---------------------------------------------------------------------------