MDI forms can't be Modal
Posted on 2004-09-02
In the following code "frmMain" is a MDI form. Since MDI forms can't be Modal, the execution of the code will continue to "GlobalErrorHandlerDestroy" and deactivate
my error handler as quickly as it has been activated. Is there any workaround? In other words, I only want "GlobalErrorHandlerDestroy" to be exexuted when the
program is being terminated (fMain being closed).
Public Sub Main()
Const csSUBNAME As String = "main"
On Error GoTo ErrorHandler
Set fMain = New frmMain
fMain.Show '(VBModal can be used here)
If go_Err Is Nothing Then
MsgBox "Could not initialise error handler.", vbCritical
If go_Err.ErrReport(Err, Erl, csMODULENAME, csSUBNAME) Then Resume