When I open the STATUS window (WC8.4) I have the compiled EXE running on the server. I have 'debug mode', 'show status' and 'live reload' checked by default on the "Web Connection Status" page.
If I UNcheck 'Live Reload', I get the error "Window 'COMMAND' has not been defined"
I came to discover this because my application occasionally hangs and I'm trying to determine why. When it DOES hang I get the same error: "Window 'COMMAND' has not been defined"
I suspect it's coming through FUNCTION LiveReloadShutdown but I have not yet traced it further...
Thoughts?
COMMAND is the FoxPro Command Window. Why would that not be available in your environment?
It's this code in LiveReloadServer that restarts the application:
ACTIVATE WINDOW COMMAND
KEYBOARD [CLEAR PROGRAM{ENTER}] + ;
lcRelaunchCommand + ;
[{ENTER}]
LiveReload for the FoxPro server (ie. source code changes) does not work on a deployed server and doesn't make sense there - it's a development feature that requires running inside of the IDE to be useful. The connector live reload can be used for script updates though but that's not hitting hte foxpro server.
IOW, there are two modes to LiveReload
Connector Mode
Handles Html, CSS, Scripts and Templates - anything in the\webfolder basically. Detects changes and reloads pages.FoxPro Server Mode
Handles FoxPro server reloading - prg file changes basically. Detects change, closes app and restarts it.
I have VFP installed on the server, and when I open VFP, close the command window, and run a one-line program containing only "ACTIVATE WINDOW command", a command window opens fine.
I will add a new FUNCTION to the compiled WC program to just "ACTIVATE WINDOW command" for further testing.
If you have further thoughts, please share.
I just double checked because I couldn't remember to make sure that FoxPro LiveReload doesn't run when not running interactively, but LiveReload is never loaded if not running in _VFP.StartMode = 0.
I'm not sure what would possibly remove the COMMAND window and make that not available - it can be hidden or not visible but the window should always be around unless something in the environment is removing it completely.
IAC the workaround for this is to turn off LiveReload as without that command window code the whole concept doesn't work. The app has to literally be shut down, then be started back up and the only way to really do that is to exit, then start it again 'manually' which is what that command window code does. It'd be nice if I could just restart the server, but the issue there is that libraries won't unload and code won't recompile reliably, unless the code is shut down.
+++ Rick ---
Yes - I kinda forgot we cannot open a command window from an EXE (I knew that once upon a time)... so I just need to remember to un-check the Debug Mode, Show Status, AND Live Reload checkboxes on the live server?
(You can ignore the stuff below this line - it's just here for the record)
===========================================================================
- I created a project called TestMe.pjx
- I added a one-line TestMe.PRG with the contents: 'Activate Window Command'
- I set the PRG as MAIN
- I compiled the project to TestMe.EXE
- I ran TestMe.EXE
- I got the error "Window 'COMMAND' has not been defined"
So... how are we expecting to run a command window from within a compiled EXE?
Don't we need to have a separate standalone PRG, compile it, and DO the standalone prg from within the EXE?
As I said WWWC doesn't load FoxPro LiveReload if you're running the EXE directly and it's never activated in COM mode. It should only work when you're interactively running from the command window and _VFP.StartMode = 0.
So this still seems mysterious.
+++ Rick ---