I have an application that resides in the system tray and checks every so often whether pop3 servers have received new mail via a winsock control. The only way to exit this appllication is to right click the icon and select 'Exit'.
This works without a problem in the IDE, but when run as a stand-alone executable Windows gives me the "Tell Microsoft about this problem" dialog. This is the error's signature:
AppName: pop3 check.exe AppVer: 0.8.0.9 ModName: kernel32.dll
ModVer: 5.1.2600.2180 Offset: 0001eb33
So... probably something in kernel32.dll? Any ideas? My exit code is the following:
I tried putting the end statement in any conceivable place in this sub and even in the event that calls this routine, but I still get the same error. So it's probably not my exit code--but then, what is it??
Any ideas on where to start would be great.
__________________
code is enduring
This works without a problem in the IDE, but when run as a stand-alone executable Windows gives me the "Tell Microsoft about this problem" dialog. This is the error's signature:
AppName: pop3 check.exe AppVer: 0.8.0.9 ModName: kernel32.dll
ModVer: 5.1.2600.2180 Offset: 0001eb33
So... probably something in kernel32.dll? Any ideas? My exit code is the following:
Code:
Public Sub dsCloseApplication()
'----------------------------------------------------------------------------------
' Purpose : Removes the tray icon, closes the winsock connection, closes all forms,
' sets the classes to nothing and exits the application
' Inputs : None
' Returns : Nothing
' Outputs : Nothing
' Notes : None
' Usage : BL.dsCloseApplication
' Author : Marco Hokke
' Date : 26-10-2004
'----------------------------------------------------------------------------------
On Error GoTo ErrHandler
'remove the icon from the system tray
UCL.dsDeleteTrayIcon
'close any winsock connections
frmMain.Winsock1.Close
'local variable to loop through forms
Dim frm As Form
'loop through the forms in this application and close all of them
For Each frm In Forms
Unload frm
Next
'clear the classes
Set DCL = Nothing
Set DL = Nothing
Set UCL = Nothing
'exit application
End
ErrHandler:
dsSemReport dfSemCreate("clsBusinessLayer:dsCloseApplication", Err.Number, Err.Description & vbCrLf & "POP3 Check will now terminate.")
End
End Sub
I tried putting the end statement in any conceivable place in this sub and even in the event that calls this routine, but I still get the same error. So it's probably not my exit code--but then, what is it??
Any ideas on where to start would be great.
__________________
code is enduring