home *** CD-ROM | disk | FTP | other *** search
- * MAPIERR.PRG
- * This function handles return/error codes and displays
- * an error message where appropriate.
-
- PARAMETER getcode
-
- PRIVATE errcode,alrtwind
- errcode = .F.
- alrtwind = 'F'
-
- **** Message Box Definitions ****
- #DEFINE mb_ok 0
- #DEFINE mb_iconexcl 48
- #DEFINE mb_title "Microsoft FoxPro"
-
-
- * return/error codes from MAPI functions
- #DEFINE success_success 0
- #DEFINE mp_user_abort 1
- #DEFINE mp_e_failure 2
- #DEFINE mp_e_login_failure 3
- #DEFINE mp_e_disk_full 4
- #DEFINE mp_e_insufficient_memory 5
- #DEFINE mp_e_access_denied 6
- #DEFINE mp_e_tm_sessions 8
- #DEFINE mp_e_tm_files 9
- #DEFINE mp_e_tm_recipients 10
- #DEFINE mp_e_att_not_found 11
- #DEFINE mp_e_att_open_failure 12
- #DEFINE mp_e_att_write_failure 13
- #DEFINE mp_e_unknown_recipient 14
- #DEFINE mp_e_bad_reciptype 15
- #DEFINE mp_e_no_messages 16
- #DEFINE mp_e_inv_message 17
- #DEFINE mp_e_text_too_large 18
- #DEFINE mp_e_inv_session 19
- #DEFINE mp_e_type_not_supported 20
- #DEFINE mp_e_amb_recipient 21
- #DEFINE mp_e_msg_in_use 22
- #DEFINE mp_e_network_failure 23
- #DEFINE mp_e_inv_editfields 24
- #DEFINE mp_e_inv_recips 25
- #DEFINE mp_e_not_supported 26
-
-
- *Schedule+
- *For future use
- #DEFINE sp_e_inv_sent_for 10000
- #DEFINE sp_e_not_installed 10005
- #DEFINE sp_e_no_items 10010
- #DEFINE sp_e_no_schedule 10015
- #DEFINE sp_e_no_privilege 10020
- #DEFINE sp_e_address_format 10025
- #DEFINE sp_e_user 10030
- #DEFINE sp_e_item 10035
- #DEFINE sp_e_type 10040
- #DEFINE sp_e_flags 10045
- #DEFINE sp_e_assoc 10050
- #DEFINE sp_e_organizer 10055
- #DEFINE sp_e_org_id 10060
- #DEFINE sp_e_attendees 10065
- #DEFINE sp_e_time 10070
- #DEFINE sp_e_priority 10075
- #DEFINE sp_e_month 10080
- #DEFINE sp_e_restriction 10085
- #DEFINE sp_e_alarm_ring_in_past 10090
- #DEFINE sp_e_not_online 10095
- #DEFINE success_no_schedule 10100
-
-
- * return/error codes from MAPI functions
- #DEFINE zz_success_success 'Success'
- #DEFINE zz_user_abort 'User Aborted'
- #DEFINE zz_e_failure 'Mail Failure'
- #DEFINE zz_e_login_failure 'Login Failure'
- #DEFINE zz_e_disk_full 'Disk Is Full'
- #DEFINE zz_e_insufficient_memory 'Insufficient Memory'
- #DEFINE zz_e_access_denied 'Access Denied'
- #DEFINE zz_e_tm_sessions 'Too Many Sessions'
- #DEFINE zz_e_tm_files 'Too Many Files'
- #DEFINE zz_e_tm_recipients 'Too Many Recipients'
- #DEFINE zz_e_att_not_found 'Attachment Not Found'
- #DEFINE zz_e_att_open_failure 'Attachment Open Failure'
- #DEFINE zz_e_att_write_failure 'Attachment Write Failure'
- #DEFINE zz_e_unknown_recipient 'Unknown Recipient'
- #DEFINE zz_e_bad_reciptype 'Bad Recipient'
- #DEFINE zz_e_no_messages 'No Messges'
- #DEFINE zz_e_inv_message 'Invalid Message'
- #DEFINE zz_e_text_too_large 'Text Too Large'
- #DEFINE zz_e_inv_session 'Invalid Session'
- #DEFINE zz_e_type_not_supported 'Type Not Supported'
- #DEFINE zz_e_amb_recipient 'Ambiguous Recipient'
- #DEFINE zz_e_msg_in_use 'Message In Use'
- #DEFINE zz_e_network_failure 'Network Failure'
- #DEFINE zz_e_inv_editfields 'Invaid Edit Fields'
- #DEFINE zz_e_inv_recips 'Invalid Recipients'
- #DEFINE zz_e_not_supported 'Not Supported'
-
- * Checks to see if Foxtools is available to
- * use MSGBOX funtion, else WAIT WINDOW is used.
- IF !setlib(SYS(2004)+'foxtools.fll')
- alrtwind = 'W'
- ENDIF
-
- *handle return codes fromM MAPI functions
- DO CASE
- CASE getcode = success_success
- errcode = .T.
- CASE getcode = mp_user_abort
- *=doalrt(ZZ_USER_ABORT)
- CASE getcode = mp_e_failure
- =doalrt(zz_e_failure)
- CASE getcode = mp_e_login_failure
- *=doalrt(ZZ_E_LOGIN_FAILURE)
- CASE getcode = mp_e_disk_full
- =doalrt(zz_e_disk_full)
- CASE getcode = mp_e_insufficient_memory
- =doalrt(zz_e_insufficient_memory)
- CASE getcode = mp_e_access_denied
- =doalrt(zz_e_access_denied)
- CASE getcode = mp_e_tm_sessions
- =doalrt(zz_e_tm_sessions)
- CASE getcode = mp_e_tm_files
- =doalrt(zz_e_tm_files)
- CASE getcode = mp_e_tm_recipients
- =doalrt(zz_e_tm_recipients)
- CASE getcode = mp_e_att_not_found
- =doalrt(zz_e_att_not_found)
- CASE getcode = mp_e_att_open_failure
- =doalrt(zz_e_att_open_failure)
- CASE getcode = mp_e_att_write_failure
- =doalrt(zz_e_att_write_failure)
- CASE getcode = mp_e_unknown_recipient
- =doalrt(zz_e_unknown_recipient)
- CASE getcode = mp_e_bad_reciptype
- =doalrt(zz_e_bad_reciptype)
- CASE getcode = mp_e_no_messages
- =doalrt(zz_e_no_messages)
- CASE getcode = mp_e_inv_message
- =doalrt(zz_e_inv_message)
- CASE getcode = mp_e_text_too_large
- =doalrt(zz_e_text_too_large)
- CASE getcode = mp_e_inv_session
- =doalrt(zz_e_inv_session)
- CASE getcode = mp_e_type_not_supported
- =doalrt(zz_e_type_not_supported)
- CASE getcode = mp_e_amb_recipient
- =doalrt(zz_e_amb_recipient)
- CASE getcode = mp_e_msg_in_use
- =doalrt(zz_e_msg_in_us)
- CASE getcode = mp_e_network_failure
- =doalrt(zz_e_network_failure)
- CASE getcode = mp_e_inv_editfields
- =doalrt(zz_e_inv_editfields)
- CASE getcode = mp_e_inv_recips
- =doalrt(zz_e_inv_recips)
- CASE getcode = mp_e_not_supported
- =doalrt(zz_e_not_supported)
- ENDCASE
- RETURN errcode
-
- FUNCTION doalrt
- PARAMETER getmess
- IF alrtwind='W'
- WAIT WINDOW m.getmess
- ELSE
- =msgbox(m.getmess,mb_title,mb_ok+mb_iconexcl)
- ENDIF
-