How to Restart the Macintosh from Within FoxProLast reviewed: June 1, 1996Article ID: Q140694 |
The information in this article applies to:
SUMMARYIn some cases, you may need to provide a FoxPro application with the ability to restart the computer. FoxPro doesn't have the capability to do this directly, so it needs to call functions at the operating system level. On the Macintosh, this can be done with either Apple Script commands or by using C code in a shared library (MLB) or external command (XCMD).
MORE INFORMATION
Method One
Method TwoYou can get similar performance from an XCMD or from an MLB that calls routines in the Shutdown Manager (in particular ShutDwnStart() to restart, and ShutDwnPower() to shut down the machine). The following C code can be used to create an MLB that can be called from within FoxPro:
#include <pro_ext.h> #include <shutdown.h> void FAR goodbye( ParamBlk FAR *parm ){ ShutDwnStart();} FoxInfo myFoxInfo[]={ {"GOODBYE", (FPFI) goodbye, 0, ""}}; FoxTable _FoxTable={ (FoxTable FAR *) 0, sizeof(myFoxInfo) / sizeof(FoxInfo), myFoxInfo}; Once this is created, placed in a Shared Library such as Restart.mlb, and saved to the Extensions Folder in the System Folder, it can be called with the following code in FoxPro:
SET LIBRARY TO restart.mlb =goodbye()NOTE: Under Windows, you can co this with the ExitWindows API as referenced in the the following articles in the Microsoft Knowledge Base:
ARTICLE-ID: Q109607 TITLE : How to Reboot the System from Within FoxPro ARTICLE-ID: Q110254 TITLE : How to Restart Windows from Within FoxPro |
Additional reference words: VFoxMac 3.00b 2.50b 2.50c 2.60a FoxMac MAC
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |