L
Lee Kok Onn
Hi,
I have written the following code in vb2005 to reboot the windows, but end
with error "ExitWindows(EWX_REBOOT, &HFFFFFFFF)", call to PInvoke function
'shutdown!shutdown.Form1::ExitWindows' has unbalanced the stack. This is
likely because the managed PInvoke signature does not match the unmanaged
target signature"
Any ideas, can pls help.
Public Class Form1
Const EWX_LogOff As Long = 0
Const EWX_SHUTDOWN = 1
Const EWX_REBOOT = 2
Const EWX_FORCE = 4
Private Declare Function ExitWindows _
Lib "User32" Alias "ExitWindowsEx" _
(ByVal dwOptions As Long, ByVal dwReserved As Long) As Long
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
End Sub
Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
ExitWindows(EWX_REBOOT, &HFFFFFFFF)
End Sub
End Class
I have written the following code in vb2005 to reboot the windows, but end
with error "ExitWindows(EWX_REBOOT, &HFFFFFFFF)", call to PInvoke function
'shutdown!shutdown.Form1::ExitWindows' has unbalanced the stack. This is
likely because the managed PInvoke signature does not match the unmanaged
target signature"
Any ideas, can pls help.
Public Class Form1
Const EWX_LogOff As Long = 0
Const EWX_SHUTDOWN = 1
Const EWX_REBOOT = 2
Const EWX_FORCE = 4
Private Declare Function ExitWindows _
Lib "User32" Alias "ExitWindowsEx" _
(ByVal dwOptions As Long, ByVal dwReserved As Long) As Long
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
End Sub
Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
ExitWindows(EWX_REBOOT, &HFFFFFFFF)
End Sub
End Class