wwServer::OnInit

This method is called at the very beginning of the server's initialization sequence and should make no assumptions about any server state.

Use this method to override the startup folder and the location of the startup configuration, but little else.

Note you should keep the code in OnInit minimal. You'll get another chance to configure your application after the server has loaded its configuration state in OnLoadCompleted() which fires after the server settings have been initialized, and OnLoad() which fires on the first request to the server.

We recommend most configuration tasks are performed in the OnLoad() to maximize server startup performance in COM mode. There preferrably should be no application logic code inside of OnInit() or OnInitCompleted()

o.OnInit()

Remarks

This is an abstract method without implementation in the base class. This class should always be implemented by the subclass of wwServer.

Example

*** Typical code that goes into this method
PROTECTED FUNCTION OnInit

*** Location of the startup INI file 
THIS.cAppIniFile= addbs(THIS.cAppStartPath) + "wcmain.ini"

*** This URL is executed when clicking on the Automation Server
*** Form's Exit button. It forces operation through a browser!
THIS.cCOMReleaseUrl="http://localhost/wconnect/wc.dll/maintain?release"

#IF !DEBUGMODE
   *** Backup Error handler only - startup code and a few file access errors
   ***                             are the only things handled by this one
   ON ERROR DO ErrorHandler WITH ;
              ERROR(),MESSAGE(),MESSAGE(1),SYS(16),LINENO() ;
              IN WCMAIN.PRG
   SET RESOURCE OFF
#ENDIF

ENDFUNC
* OnInit

See also:

Class wwServer | wwServer::OnLoad

© West Wind Technologies, 1996-2019 • Updated: 01/27/18
Comment or report problem with topic