home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a108 / 6.ddi / SAMPLES / ATTACH / MAPIERR.PRG < prev    next >
Encoding:
Text File  |  1993-08-27  |  5.6 KB  |  169 lines

  1. * MAPIERR.PRG
  2. * This function handles return/error codes and displays
  3. * an error message where appropriate.
  4.  
  5. PARAMETER getcode
  6.  
  7. PRIVATE errcode,alrtwind
  8. errcode = .F.
  9. alrtwind = 'F'
  10.  
  11. **** Message Box Definitions ****
  12. #DEFINE mb_ok                0
  13. #DEFINE mb_iconexcl         48
  14. #DEFINE mb_title        "Microsoft FoxPro"
  15.  
  16.  
  17. * return/error codes from MAPI functions
  18. #DEFINE success_success                 0
  19. #DEFINE mp_user_abort                   1
  20. #DEFINE mp_e_failure                    2
  21. #DEFINE mp_e_login_failure              3
  22. #DEFINE mp_e_disk_full                  4
  23. #DEFINE mp_e_insufficient_memory           5
  24. #DEFINE mp_e_access_denied                6
  25. #DEFINE mp_e_tm_sessions                8
  26. #DEFINE mp_e_tm_files                   9
  27. #DEFINE mp_e_tm_recipients              10
  28. #DEFINE mp_e_att_not_found                 11
  29. #DEFINE mp_e_att_open_failure              12
  30. #DEFINE mp_e_att_write_failure             13
  31. #DEFINE mp_e_unknown_recipient          14
  32. #DEFINE mp_e_bad_reciptype              15
  33. #DEFINE mp_e_no_messages                16
  34. #DEFINE mp_e_inv_message                  17
  35. #DEFINE mp_e_text_too_large             18
  36. #DEFINE    mp_e_inv_session                19
  37. #DEFINE    mp_e_type_not_supported            20
  38. #DEFINE    mp_e_amb_recipient                21
  39. #DEFINE mp_e_msg_in_use                    22
  40. #DEFINE mp_e_network_failure            23
  41. #DEFINE    mp_e_inv_editfields                24
  42. #DEFINE    mp_e_inv_recips                    25
  43. #DEFINE    mp_e_not_supported                26
  44.  
  45.  
  46. *Schedule+
  47. *For future use
  48. #DEFINE        sp_e_inv_sent_for            10000
  49. #DEFINE        sp_e_not_installed            10005
  50. #DEFINE        sp_e_no_items                10010
  51. #DEFINE        sp_e_no_schedule            10015
  52. #DEFINE        sp_e_no_privilege            10020
  53. #DEFINE        sp_e_address_format            10025
  54. #DEFINE        sp_e_user                    10030
  55. #DEFINE        sp_e_item                    10035
  56. #DEFINE        sp_e_type                    10040
  57. #DEFINE        sp_e_flags                    10045
  58. #DEFINE        sp_e_assoc                    10050
  59. #DEFINE        sp_e_organizer                10055
  60. #DEFINE        sp_e_org_id                    10060
  61. #DEFINE        sp_e_attendees                10065
  62. #DEFINE        sp_e_time                    10070
  63. #DEFINE        sp_e_priority                10075
  64. #DEFINE        sp_e_month                    10080
  65. #DEFINE        sp_e_restriction            10085
  66. #DEFINE        sp_e_alarm_ring_in_past        10090
  67. #DEFINE        sp_e_not_online                10095
  68. #DEFINE        success_no_schedule            10100
  69.  
  70.  
  71. * return/error codes from MAPI functions
  72. #DEFINE zz_success_success              'Success'
  73. #DEFINE zz_user_abort                   'User Aborted'
  74. #DEFINE zz_e_failure                    'Mail Failure'
  75. #DEFINE zz_e_login_failure              'Login Failure'
  76. #DEFINE zz_e_disk_full                  'Disk Is Full'
  77. #DEFINE zz_e_insufficient_memory           'Insufficient Memory'
  78. #DEFINE zz_e_access_denied                'Access Denied'
  79. #DEFINE zz_e_tm_sessions                'Too Many Sessions'
  80. #DEFINE zz_e_tm_files                   'Too Many Files'
  81. #DEFINE zz_e_tm_recipients              'Too Many Recipients'
  82. #DEFINE zz_e_att_not_found                 'Attachment Not Found'
  83. #DEFINE zz_e_att_open_failure              'Attachment Open Failure'
  84. #DEFINE zz_e_att_write_failure             'Attachment Write Failure'
  85. #DEFINE zz_e_unknown_recipient          'Unknown Recipient'
  86. #DEFINE zz_e_bad_reciptype              'Bad Recipient'
  87. #DEFINE zz_e_no_messages                'No Messges'
  88. #DEFINE zz_e_inv_message                  'Invalid Message'
  89. #DEFINE zz_e_text_too_large             'Text Too Large'
  90. #DEFINE    zz_e_inv_session                'Invalid Session'
  91. #DEFINE    zz_e_type_not_supported            'Type Not Supported'
  92. #DEFINE    zz_e_amb_recipient                'Ambiguous Recipient'
  93. #DEFINE zz_e_msg_in_use                    'Message In Use'
  94. #DEFINE zz_e_network_failure            'Network Failure'
  95. #DEFINE    zz_e_inv_editfields                'Invaid Edit Fields'
  96. #DEFINE    zz_e_inv_recips                    'Invalid Recipients'
  97. #DEFINE    zz_e_not_supported                'Not Supported'
  98.  
  99. * Checks to see if Foxtools is available to
  100. * use MSGBOX funtion, else WAIT WINDOW is used.
  101. IF !setlib(SYS(2004)+'foxtools.fll')
  102.     alrtwind = 'W'
  103. ENDIF
  104.  
  105. *handle return codes fromM  MAPI functions
  106. DO CASE
  107.     CASE getcode = success_success
  108.         errcode = .T.
  109.     CASE getcode = mp_user_abort
  110.         *=doalrt(ZZ_USER_ABORT)
  111.     CASE getcode = mp_e_failure
  112.         =doalrt(zz_e_failure)
  113.     CASE getcode = mp_e_login_failure
  114.         *=doalrt(ZZ_E_LOGIN_FAILURE)
  115.     CASE getcode = mp_e_disk_full
  116.         =doalrt(zz_e_disk_full)
  117.     CASE getcode = mp_e_insufficient_memory
  118.         =doalrt(zz_e_insufficient_memory)
  119.     CASE getcode = mp_e_access_denied
  120.         =doalrt(zz_e_access_denied)
  121.     CASE getcode = mp_e_tm_sessions
  122.         =doalrt(zz_e_tm_sessions)
  123.     CASE getcode = mp_e_tm_files
  124.         =doalrt(zz_e_tm_files)
  125.     CASE getcode = mp_e_tm_recipients
  126.         =doalrt(zz_e_tm_recipients)
  127.     CASE getcode = mp_e_att_not_found
  128.         =doalrt(zz_e_att_not_found)
  129.     CASE getcode = mp_e_att_open_failure
  130.         =doalrt(zz_e_att_open_failure)
  131.     CASE getcode = mp_e_att_write_failure
  132.         =doalrt(zz_e_att_write_failure)
  133.     CASE getcode = mp_e_unknown_recipient
  134.         =doalrt(zz_e_unknown_recipient)
  135.     CASE getcode = mp_e_bad_reciptype
  136.         =doalrt(zz_e_bad_reciptype)
  137.     CASE getcode = mp_e_no_messages
  138.         =doalrt(zz_e_no_messages)
  139.     CASE getcode = mp_e_inv_message
  140.         =doalrt(zz_e_inv_message)
  141.     CASE getcode = mp_e_text_too_large
  142.         =doalrt(zz_e_text_too_large)
  143.     CASE getcode = mp_e_inv_session
  144.         =doalrt(zz_e_inv_session)
  145.     CASE getcode = mp_e_type_not_supported
  146.         =doalrt(zz_e_type_not_supported)
  147.     CASE getcode = mp_e_amb_recipient
  148.         =doalrt(zz_e_amb_recipient)
  149.     CASE getcode = mp_e_msg_in_use
  150.         =doalrt(zz_e_msg_in_us)
  151.     CASE getcode = mp_e_network_failure
  152.         =doalrt(zz_e_network_failure)
  153.     CASE getcode = mp_e_inv_editfields
  154.         =doalrt(zz_e_inv_editfields)
  155.     CASE getcode = mp_e_inv_recips
  156.         =doalrt(zz_e_inv_recips)
  157.     CASE getcode = mp_e_not_supported
  158.         =doalrt(zz_e_not_supported)
  159. ENDCASE
  160. RETURN errcode
  161.  
  162. FUNCTION doalrt
  163.     PARAMETER getmess
  164.     IF alrtwind='W'
  165.         WAIT WINDOW m.getmess
  166.     ELSE
  167.         =msgbox(m.getmess,mb_title,mb_ok+mb_iconexcl)
  168.     ENDIF
  169.