home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2002 March / PCWMAR02.iso / software / turbocad / v8trial / TurboCADv8ProfessionalNoReg.exe / Data.Cab / F41065_modEvents.bas < prev    next >
Encoding:
BASIC Source File  |  2001-10-16  |  1.3 KB  |  38 lines

  1. Attribute VB_Name = "modEvents"
  2. '******************************************************************'
  3. '*                                                                *'
  4. '*                      TurboCAD for Windows                      *'
  5. '*                   Copyright (c) 1993 - 2001                    *'
  6. '*             International Microcomputer Software, Inc.         *'
  7. '*                            (IMSI)                              *'
  8. '*                      All rights reserved.                      *'
  9. '*                                                                *'
  10. '******************************************************************'
  11.  
  12. Option Explicit
  13.  
  14. Dim eventHandler As New clsEvents
  15. Dim idEvents As Long
  16.  
  17. Public Sub Main()
  18.     On Error Resume Next
  19.     Dim mask As Long
  20.     frmEvents.Show
  21.     mask = frmEvents.GetEventMask()
  22.     If idEvents <> 0 Then
  23.         Debug.Print "Disconnecting events " & idEvents
  24.         Application.DisconnectEvents idEvents
  25.         idEvents = 0
  26.     End If
  27.     If mask <> 0 Then
  28.         On Error GoTo ConnectError
  29.         idEvents = Application.ConnectEvents(eventHandler, mask)
  30.         Debug.Print "Connected events " & idEvents
  31.     End If
  32.     Exit Sub
  33.     
  34. ConnectError:
  35.     MsgBox "Error connecting events: " & Err.Description
  36. End Sub
  37.  
  38.