Jump to content


Photo

Application/Service/Library in one project. .dpr template.


  • Please log in to reply
2 replies to this topic

#1 rgreat

rgreat

    Active Member

  • uniGUI Subscriber
  • PipPipPip
  • 91 posts

Posted 13 September 2017 - 06:24 PM

// Use one of 3 defines below to choose compile mode:

//{$DEFINE UNIGUI_VCL}      // Stand Alone Application.
//{$DEFINE UNIGUI_SERVICE}  // Windows Service Application.
//{$DEFINE UNIGUI_ISAPI}    // ISAPI Library.

{$IFDEF UNIGUI_SERVICE}
  {$EXTENSION exe}
  program
{$ENDIF}
{$IFDEF UNIGUI_VCL}
  {$EXTENSION exe}
  program
{$ENDIF}
{$IFDEF UNIGUI_ISAPI}
  {$EXTENSION dll}
  library
{$ENDIF}
  MyProgram;  // Your project name.

uses
{$IFDEF UNIGUI_SERVICE}
  SvcMgr,
{$ENDIF}
{$IFDEF UNIGUI_VCL}
  Forms,
{$ENDIF}
{$IFDEF UNIGUI_ISAPI}
  uniGUIISAPI,
{$ENDIF}
  ServerModule in 'ServerModule.pas' {UniServerModule: TUniGUIServerModule},
  MainModule in 'MainModule.pas' {UniMainModule: TUniGUIMainModule},
  ServiceModule in 'ServiceModule.pas', // Grab this one from a new uniGui service project.
  // Add your custom units here. 

{$R *.res}

{$IFDEF UNIGUI_ISAPI}
exports
  GetExtensionVersion,
  HttpExtensionProc,
  TerminateExtension;
{$ENDIF}

begin
{$IFDEF UNIGUI_SERVICE}
  if not Application.DelayInitialize or Application.Installing then
    Application.Initialize;
  Application.CreateForm(TMyServiceClass, MyServiceClass);  // Get from your ServiceModule.
  Application.Run;
{$ENDIF}
{$IFDEF UNIGUI_VCL}
  ReportMemoryLeaksOnShutdown:=True;  // Optional.
  Application.Initialize;
  TUniServerModule.Create(Application);
  Application.Run;
{$ENDIF}
end.

  • 0

#2 Tokay

Tokay

    Member

  • uniGUI Subscriber
  • PipPip
  • 40 posts

Posted 14 September 2017 - 08:14 AM

thank you!


  • 0

#3 Stefano Monterisi

Stefano Monterisi

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 103 posts

Posted 15 September 2017 - 08:42 AM

Thanks!!


  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users