39 lines
812 B
ObjectPascal
39 lines
812 B
ObjectPascal
program AgentPLCtoMQTT;
|
|
|
|
uses
|
|
Winapi.Windows,
|
|
Vcl.Forms,
|
|
Vcl.Dialogs,
|
|
uMain in 'uMain.pas' {fMain},
|
|
Vcl.Themes,
|
|
Vcl.Styles,
|
|
UMQTTClient in 'UMQTTClient.pas';
|
|
|
|
{$R *.res}
|
|
|
|
var
|
|
HMutex: THandle;
|
|
HMutex_old: THandle;
|
|
|
|
begin
|
|
HMutex_old := CreateMutex(nil, True, 'Smart xFarm Comm');
|
|
if GetLastError = ERROR_ALREADY_EXISTS then
|
|
begin
|
|
ShowMessage('[Warning] Smart xFarm Comm (OLD) already running');
|
|
Exit;
|
|
end;
|
|
|
|
HMutex := CreateMutex(nil, True, 'SmartFarm PLCtoMQTT');
|
|
if GetLastError = ERROR_ALREADY_EXISTS then
|
|
begin
|
|
ShowMessage('[Warning] SmartFarm PLCtoMQTT already running');
|
|
Exit;
|
|
end;
|
|
|
|
Application.Initialize;
|
|
Application.MainFormOnTaskbar := True;
|
|
TStyleManager.TrySetStyle('Tablet Dark');
|
|
Application.CreateForm(TfMain, fMain);
|
|
Application.Run;
|
|
end.
|