|
-
Sep 6th, 2000, 04:24 AM
#1
Thread Starter
New Member
In my Application, I have the following code :
Code:
Private Declare Sub ExitProcess Lib "kernel32" _
(ByVal uExitCode As Long)
Private lExitCode As Long
Private Sub Form_Load()
lExitCode = 0&
End Sub
Private Sub mnuExport_Click()
mnuExport.Checked = IIf(mnuExport.Checked, vbUnchecked,
vbChecked)
If (mnuExport.Checked) Then lExitCode = 1&
End Sub
Private Sub Form_Terminate()
ExitProcess lExitCode
End Sub
But this return always 0 even if I check the item in my menu
And when I try to place a breakpoint on ExitProcess and execute, it causes a GPF(General Protection Fault) and VB crashes....
Anyone has knowledge of this bug or know a solution ?
Nicolas Joannidès
Visual Basic, C, ASP
[email protected]
-
Sep 6th, 2000, 06:33 AM
#2
could try using mnuExport.value with true false options instead?
-
Sep 6th, 2000, 12:49 PM
#3
Lively Member
Try using the ExitProcess with the actual exit value instead of a variable containing the exit value:
Code:
Private Sub Form_Terminate()
If(mnuExport.Checked) then
ExitProcess 1&
Else
ExitProcess 0&
EndIf
End Sub
I think that will work.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|