Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
More shutdown
Message
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00087155
Message ID:
00087300
Views:
36
>>Dear Nigel,
>>Thank you for your help. Due to my inabilty to follow
>>instructions despite the completeness of Mr.Rauh's
>>directions I have had the following problems iln
>>implimenting them. I'm sure you were more
>>sucessful as I simply do not have the requisite
>>experience with API and made some stupid error.
>>1) On the Declare Integer ExitProcess IN Win32API;
>> Integer Exitcode I get an error "Cannot find entry
>> point Process in the dll.
>>2) ON SHUTDOWN Exit Process(0)
>> I get "unrecognized command verb".
>>3) nMyReturnValue=ExitWindowsEx(nChosenShutdownMode,(0)
>> Returns "variable'NCHOSENSHUTDOWNMODE' is not found"
>>
>>I am hoping you will shed some light on what I am doing
>>wrong. Thanks Derek Linebarger.
>
>I'm not exactly certain of what it is you're trying to do here. From what I gather, however, it seems as if you're trying to quit both the application and Windows at the same time, but giving the user the opportunity to chose the shutdown mode. However, once ExitProcess has executed, any code following won't exuecute.
>
>I haven't had a problem using the following declaration:
>
>
>DECLARE ExitProcess IN Win32API;
>  INTEGER nExitCode
>
>
>And passing 0 to it does shutdown the current process. Note that I don't declare a return type. While I don't think it's part of the problem, the API documentation shows this function as not returning a value (it's shown as VOID), therefore the above is correct.
>
>I'm wondering why, however, you just don't do the clean up yourself and CLEAR EVENTS.
>
>As far as ExitWindowsEx, I think that the problem is that you have declared what nChosenShutMode is. It should be one of the following values:
>
>
>#DEFINE EWX_LOGOFF   0
>#DEFINE EWX_SHUTDOWN 1
>#DEFINE EWX_REBOOT   2
>#DEFINE EWX_FORCE    4
>#DEFINE EWX_POWEROFF 8
>
>
>Here's what each of them do:
>
>EWX_LOGOFF - All processes are forced to terminate regardless of whether or not the respond. In VFP, the system then re-starts.
>
>EWX_SHUTDOWN - Shuts down the system to a point at which it is safe to turn off the power. All file buffers have been flushed to disk, and all running processes have stopped.
>
>EWX_REBOOT Shuts down the system and then restarts Windows.
>
>EWX_FORCE - All processes are forced to terminate regardless of whether or not the respond. In VFP, the system then re-starts.
>
>EWX_POWEROFF - Shuts down the system and turns off the power. The system must support the power-off feature.
>
>My tests indicated the following on a Novell network: Both EWX_LOGOFF and EWX_FORCE produced the same result. Windows reported that a network application (VFP) was not responding, treated it as an error, and restarted Windows.
>
>hth,

George,
I think Derek misunderstood Ed Rauh's instructions earlier in the thread. I tested the shutdown based on Ed's code and had to modify because ExitProcess(0) also gave me an error but if I put the return in it worked ok. As for the option required in ExitWindowsEx(), I think Derek misread that bit. I will add the extra items you have given here to my own shutdown procedures. Thanks,
Nigel B Coates
NBC Software Services
Dublin, Ireland.
eMail: Nigel.Coates@NBCSoftware.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform