diff --git a/Source/Servidor/FactuGES_Server.dpr b/Source/Servidor/FactuGES_Server.dpr
index ec8a8d1..123b18b 100644
--- a/Source/Servidor/FactuGES_Server.dpr
+++ b/Source/Servidor/FactuGES_Server.dpr
@@ -1,9 +1,9 @@
program FactuGES_Server;
-
{#ROGEN:..\Servicios\FactuGES.rodl} // RemObjects: Careful, do not remove!
uses
uROComInit,
+ uROComboService,
Forms,
uServerMainForm in 'uServerMainForm.pas' {fServerForm},
uAcercaDe in 'uAcercaDe.pas' {fAcercaDe},
@@ -141,13 +141,27 @@ uses
{$R *.res}
{$R ..\Servicios\RODLFile.res}
+const
+ FACTUGES_NAME = 'FactuGES Servidor';
+
begin
+ if ROStartService(FACTUGES_NAME, FACTUGES_NAME) then
+ begin
+ // Aqui hay que comprobar antes si el servicio ya est en ejecucion
+
+ ROService.CreateForm(TdmServer, dmServer);
+ ROService.Run;
+ Exit;
+ end;
+
Application.Initialize;
- //ReportMemoryLeaksOnShutdown := True; //
- Application.Title := 'FactuGES (Servidor)';
+// ReportMemoryLeaksOnShutdown := True;
+ Application.Title := FACTUGES_NAME;
Application.ShowMainForm := False;
+ Application.CreateForm(TdmServer, dmServer);
Application.CreateForm(TfServerForm, fServerForm);
Application.Run;
Application.Terminate;
end.
+
diff --git a/Source/Servidor/FactuGES_Server.dproj b/Source/Servidor/FactuGES_Server.dproj
index 8cf76ea..4f9691c 100644
--- a/Source/Servidor/FactuGES_Server.dproj
+++ b/Source/Servidor/FactuGES_Server.dproj
@@ -28,7 +28,7 @@
Delphi.Personality
- FalseTrueFalseTrueFalse2470FalseFalseFalseFalseFalse30821252Rodax Software S.L.2.4.7.0FactuGES (Servidor)2.4.7.0martes, 27 de diciembre de 2011 15:54
+ FalseTrueFalseTrueFalse2480FalseFalseFalseFalseFalse30821252Rodax Software S.L.2.4.8.0FactuGES (Servidor)2.4.8.0lunes, 16 de enero de 2012 10:45
File C:\Documents and Settings\All Users\Documentos\RAD Studio\5.0\Bpl\dxPScxScheduler2LnkD11.bpl not found
FactuGES_Server.dpr
diff --git a/Source/Servidor/FactuGES_Server.res b/Source/Servidor/FactuGES_Server.res
index 42cdf7b..36bebf3 100644
Binary files a/Source/Servidor/FactuGES_Server.res and b/Source/Servidor/FactuGES_Server.res differ
diff --git a/Source/Servidor/uDataModuleServer.pas b/Source/Servidor/uDataModuleServer.pas
index 282e539..df1c363 100644
--- a/Source/Servidor/uDataModuleServer.pas
+++ b/Source/Servidor/uDataModuleServer.pas
@@ -6,7 +6,7 @@ uses
SysUtils, Classes, SyncObjs, uDAEngine, uDAIBXDriver, JvLogFile, uROSessions,
JvComponentBase, JvAppStorage, JvAppRegistryStorage, uDAClasses,
uDADriverManager, uROClient, uROBinMessage, uROServer, uROIndyTCPServer,
- uROIndyHTTPServer, uDAInterfaces;
+ uROIndyHTTPServer, uDAInterfaces, uROComboService;
const
SERVER_PORT = '8099'; // Puerto por defecto
@@ -294,7 +294,8 @@ begin
ConnectionName := ConnectionManager.GetDefaultConnectionName;
ConnectionManager.Connections.GetDefaultConnection.ConnectionString := GetConnectionString;
- ShowBalloonHint('Conectado a ' + ConnectionName, bfInfo);
+ if not ROIsService then
+ ShowBalloonHint('Conectado a ' + ConnectionName, bfInfo);
CoInitialize(nil);
HTTPServer.Active := TRUE;
diff --git a/Source/Servidor/uServerMainForm.pas b/Source/Servidor/uServerMainForm.pas
index 868a878..0b8cb2d 100644
--- a/Source/Servidor/uServerMainForm.pas
+++ b/Source/Servidor/uServerMainForm.pas
@@ -53,7 +53,7 @@ var
implementation
uses
- uDataModuleServer, uConfiguracion, uAcercaDe, uServerAppUtils;
+ uDataModuleServer, uConfiguracion, uAcercaDe, uServerAppUtils, uROComboService;
{$R *.dfm}
@@ -83,21 +83,22 @@ procedure TfServerForm.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
begin
CanClose := False;
- with JvProgressDialog1 do
- begin
- InitValues(0, 100, 10, 0, 'Cerrar FactuGES Server', 'Espere mientras FactuGES Server se cierra...');
- Show;
- while dmServer.HTTPServer.Active do
+ if not ROIsService then
+ with JvProgressDialog1 do
begin
- if (Position + Interval > Max) then
- Position := Min
- else
- Position := Position + Interval;
- Refresh;
- dmServer.HTTPServer.Active := False;
+ InitValues(0, 100, 10, 0, 'Cerrar FactuGES Server', 'Espere mientras FactuGES Server se cierra...');
+ Show;
+ while dmServer.HTTPServer.Active do
+ begin
+ if (Position + Interval > Max) then
+ Position := Min
+ else
+ Position := Position + Interval;
+ Refresh;
+ dmServer.HTTPServer.Active := False;
+ end;
+ Hide;
end;
- Hide;
- end;
CanClose := True;
end;