Dalsi zmeny
This commit is contained in:
47
hdcDZApi.dpr
47
hdcDZApi.dpr
@ -1,4 +1,4 @@
|
||||
program hdcDZApi;
|
||||
program hdcDZApi;
|
||||
|
||||
{$IFDEF DEBUG}
|
||||
{$APPTYPE CONSOLE}
|
||||
@ -11,6 +11,11 @@ uses
|
||||
Vcl.SvcMgr,
|
||||
System.SysUtils,
|
||||
Winapi.Windows,
|
||||
System.Classes,
|
||||
|
||||
{$IFDEF DEBUG}
|
||||
Web.WebReq,
|
||||
{$ENDIF}
|
||||
|
||||
MVCFramework.Middleware.Swagger,
|
||||
MVCFramework.Swagger.Commons,
|
||||
@ -78,6 +83,7 @@ uses
|
||||
,uHeOObj_Custom in '_custom\INCOSystems\uHeOObj_Custom.pas'
|
||||
,uCtrlCustom in '_custom\INCOSystems\uCtrlCustom.pas'
|
||||
,uSvcCustom in '_custom\INCOSystems\uSvcCustom.pas'
|
||||
{$R .\_custom\INCOSystems\zdroje.RES}
|
||||
{$ENDIF}
|
||||
|
||||
{$IFDEF CUSTOM_CTRL_Gornicky}
|
||||
@ -93,6 +99,13 @@ uses
|
||||
,uSvcCustom in '_custom\EMPolar\uSvcCustom.pas'
|
||||
{$R '_custom\EMPolar\zdroje.RES'}
|
||||
{$ENDIF}
|
||||
|
||||
{$IFDEF CUSTOM_CTRL_Westra}
|
||||
,uHeOObj_Custom in '_custom\Westra\uHeOObj_Custom.pas'
|
||||
,uCtrlCustom in '_custom\Westra\uCtrlCustom.pas'
|
||||
,uSvcCustom in '_custom\Westra\uSvcCustom.pas'
|
||||
{$R '_custom\Westra\zdroje.RES'}
|
||||
{$ENDIF}
|
||||
;
|
||||
|
||||
|
||||
@ -123,7 +136,10 @@ var Event : TInputrecord;
|
||||
var started: boolean;
|
||||
var stopped: boolean;
|
||||
|
||||
Application.Initialize;
|
||||
Application.CreateForm (TdatMod, datMod);
|
||||
// Application.CreateForm(TWebModule1, WebModule1);
|
||||
|
||||
// In debug mode the server acts as a console application.
|
||||
// Create the TService descendant manually.
|
||||
|
||||
@ -134,6 +150,10 @@ var Event : TInputrecord;
|
||||
|
||||
HDCDZApiService.ServiceAfterInstall (HDCDZApiService);
|
||||
|
||||
|
||||
if (WebRequestHandler<>nil) then
|
||||
WebRequestHandler.WebModuleClass := WebModuleClass;
|
||||
|
||||
// Simulate service start.
|
||||
HDCDZApiService.ServiceStart (HDCDZApiService, started);
|
||||
// Keep the console box running (ServerContainer1 code runs in the background)
|
||||
@ -179,9 +199,32 @@ var Event : TInputrecord;
|
||||
|
||||
|
||||
begin
|
||||
ReportMemoryLeaksOnShutdown:= false;
|
||||
ReportMemoryLeaksOnShutdown:= true;
|
||||
|
||||
{$IFDEF DEBUG}
|
||||
{
|
||||
if not Application.DelayInitialize or Application.Installing then
|
||||
Application.Initialize;
|
||||
|
||||
Application.CreateForm(THDCDZApiService, HDCDZApiService);
|
||||
Application.CreateForm(TdatMod, datMod);
|
||||
// thread čekající na ENTER
|
||||
TThread.CreateAnonymousThread(
|
||||
procedure
|
||||
var Stopped: Boolean;
|
||||
begin
|
||||
Writeln('Stiskem ENTER ukončete...');
|
||||
Readln;
|
||||
|
||||
TThread.Queue(nil,
|
||||
procedure
|
||||
begin
|
||||
HDCDZApiService.ServiceStop(HDCDZApiService, Stopped);
|
||||
end);
|
||||
end
|
||||
).Start;
|
||||
Application.Run;
|
||||
}
|
||||
SpustitJakoPrg;
|
||||
{$ELSE}
|
||||
if (FindCmdLineSwitch('dbg', true)) then
|
||||
|
||||
Reference in New Issue
Block a user