LPARAMETER IniFileName IF VARTYPE(m.IniFileName) = "C" AND NOT EMPTY(m.IniFileName) This.IniFileName = m.IniFileName ENDIF LOCAL EveryThingOK EverythingOK = .F. && Prove this wrong. IF NOT THIS.AllowMultipleInstances IF NOT THIS.CheckForMultipleInstances() && If this method returns .F., there is This.Destroy() && Destroy doesn't run automatically if the init doesn't RETURN m.EveryThingOK && another copy of this app running. This method ENDIF && will bring it forward. ENDIF * If any of these methods fail, it should return false and we * should quit. The safest technique is to use a CASE statement * so if any one thing fails, we don't compound the problem be continuing. WITH This DO CASE CASE .ShutDownApp && Something bad has already occurred. CASE NOT .PropertiesOK() && This means the PropertyHandler has done it's thing. CASE NOT .CheckBackup() && During backup time, you can't get in. CASE NOT .CheckEnableLogin() AND NOT .AdviseInit() && Determine if Login is allowed. CASE NOT .Login() && Is the user allowed in? CASE NOT .Requery() && This sets up locking and additional user info. CASE NOT .SetCaption() CASE NOT .CreateoSplashScreen() && This is where the _SCREEN.Visible = .T.! CASE NOT .SetStatus() && Allows you to show progress or status. CASE NOT .SetDblClick() && Set the DblClick speed equal to the windows setting. CASE NOT .CreateoMemory() CASE NOT .OpenTables() && Open commonly used tables, if desired. CASE NOT .CreateoSecurity() CASE NOT .CreateoRules() CASE NOT .CreateoReports() && Report object CASE NOT .SetUpHelp() CASE NOT .Refresh(.T.) CASE NOT .DefaultAction() CASE NOT .You get the idea....() OTHERWISE EveryThingOK = .T. *When a user wishes to leave Windows and the application is still running *what should happen? ON SHUTDOWN IIF(VARTYPE(ThisApp)=="O",ThisApp.Release(.T.,.F.,.T.), ; _SCREEN.Forms[2].Release()) * IIF is so if the develop runs the app twice, we can still get released via * the Forms collection. (ThisApp may be gone!) * Parameter1 is Force, * Parameter2 is FromQueryUnload * Parameter3 is FromShutDown-- this helps resolve the situation when Release is called. ENDCASE IF NOT m.EveryThingOK .CallStackReleased = .T. && This keeps the Timer in the release from being created. && We don't need it here. .Release() .Destroy() && Destroy doesn't run automatically if the init doesn't ENDIF && complete with success. ENDWITH RETURN m.EverythingOK>Like most applications, I begin with a prg that displays a splash screen, sets up the environment, opens the database, checks the user's permissions, and finally calls the menu.