*MainGemini.PRG: lcNameSystem="Gemini Plastics Quote System" lcDefDataLoc = CURDIR() && + "DATA\" oApp = CREATEOBJECT("cc_AppObject") && Create the application object. IF VARTYPE(oApp) = "O" oApp.DO(lcNameSystem, lcDefDataLoc) && Calls the menu and sets up the READ EVENTS wait state. RELEASE oApp && After a Clear Events, release the object, oApp. SET RESOURCE ON SET SYSMENU TO DEFAULT && 03/30/2006 Cecil. SET HELP TO && Cecil Champenois 08/23/2005. ELSE MESSAGEBOX("Problem loading application...") QUIT ENDIFHere is the DO method of the application object. There is more code, but this is the first line in the code and it won't execute correctly in runtime.
LPARAMETERS tcNameSystem, tcDefDataLoc * This is the DO procedure in the oApp Application Object. WITH This Local lcVersion, lcFinalVersion lcVersion = ALLTRIM(STR(VERSION(5))) && Find out the VFP version number. .cVFPVersion = " [VFP Version " + ; LEFT(lcVersion,1) + "." + ; SUBSTR(lcVersion,2,2) + "]" .cDefDataLoc = tcDefDataLoc && DEFAULT DATA Path. .cNameSystem = tcNameSystem && Name of the System. .Username = "" .UserFullName= "" .cExitMethod = "" * 02/10/2006 Cecil Champenois. Added Network Check. .IsNetwork = DIRECTORY("G:\") IF .IsNetwork = .T. lcMessage="Drive G:\ on Network is available." ELSE lcMessage="Network is NOT available." ENDIF MESSAGEBOX(lcMessage, 0, "Network status") * 02/10/2006 Cecil Champenois. End. *.lPassedLogon = .F. && This is already set in the oApp property sheet. * The TO clause returns a value from the Login form. DO FORM frmLogin TO .lPassedLogon && Return a result to the memvar, && oApp.lPassedLogon * In the Login form, initialize oApp.cUserName with the current user's * name. IF .lPassedLogon && If the user successfully passed the Login form,... PUSH MENU _msysmenu && Push the previous menu on the stack. DO (.cMenu) && Execute the user-defined menu. oApp.FunctionKeys() && 08/27/2005 Cecil. * Set some _SCREEN Properties. _SCREEN.FONTNAME = "FoxFont" _SCREEN.CLOSABLE = .F. READ EVENTS && Puts things into a wait state. ELSE .cExitMethod = "OS" && OS means Operating System. Throws user completely && back to Windows, not VFP. CLEAR EVENTS CLOSE ALL CLEAR MENU CLEAR POPUP CLEAR PROGRAM CLEAR WINDOWS CLEAR CLEAR DLLS RELEASE ALL EXTENDED ENDIF * Close the PO.DBC file. CLOSE DATABASES DO CASE CASE .cExitMethod = "VFP" WAIT WINDOW NOWAIT "Leaving GEMINI QUOTES System..." POP MENU _msysmenu TO MASTER && Restore the previous menu you saved && earlier. SET SYSMENU TO DEFAULT * Reset _SCREEN properties. _SCREEN.FONTNAME= "FoxFont" _SCREEN.CAPTION='Gemini Quotes Development - ' + ; " " + .cVFPVersion _SCREEN.CLOSABLE = .T. CLEAR MEMORY SET RESOURCE ON RETURN CASE .cExitMethod = "OS" @2,0 SAY "Leaving Gemini Quotes System..." CLEAR MEMORY QUIT ENDCASE ENDWITH