Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Trapping e-mail OLE errors
Message
De
18/01/2000 05:32:40
 
 
À
18/01/2000 03:22:11
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00318878
Message ID:
00319346
Vues:
13
I'm sorry for the confussion, but the I am doing somethinbg very similar to generate the error form. Within the error form, I have a fax and an e-mail button. Because I am already within code that has been called by the on error, it appears that any following errors can not be trapped.

>>lcOldErr = on( "error" )
>>on error llError = .t.

As you can see, I make a not of the old error trap, and just set flag if the error occurs. Works fine when e-mail from outside the error form, its just that it does not appear to be possible to trap an error from within code which is called by the on error.

The process is something like this:

on error do error form

error occurs -> run the form

from within the form - attempt to e-mail the error

******
on error set a flag if an error occurs

logon - although an error occurs,
the flag is not set and the VFP error dialog appears
****

Any ideas?




>My onerror statement is something like:
>
>ON ERROR DO screrror WITH MESSAGE(),MESSAGE(1),PROGRAM(), LINENO(),ERROR()
>
>When the mapisession login fails I get the following text in the parameter message():
>
>«OLE IDispatch exception code 0 from MAPISession: Login has failed..»
>
>And the error number is 1429 as all errors with OLE.
>
>In the init of the form called by the on error statement, I check to see if the error is 1429 and has the description above and I do what I want.
>
>
>
>>How can I trap log on errors within an error trap?
>>
>>I have an error form where the user enters who they are, where they are and a some comments. This info can then be faxed or e-mailed back to us so that it can be fixed. The problem I have is trapping the OLE error if they are not logged on or if they choose to cancel the logon. As this is already within the 'on error' then another error trap to set an error flag is ignored. Is there any way of trapping the OLE errors while using e-mail?
>>
>>By the way this routine works well else where in the app (i.e. registration).
>>
>>Here's the code and potential errors that could occur.
>>
>>* Create a mapi session
>>objSession = createobject( "mapi.session")
>>
>>* Store the current error status and set an error flag if something goes wrong
>>lcOldErr = on( "error" )
>>on error llError = .t.
>>
>>* Logoon on to the current session without any dialog
>>* An error will occur here if e-mail is not open or loged in
>>objSession.Logon( .null., .null., .f., .f.)
>>
>>if llError
>> * If an error occured while logging on automatically
>> * - present the logon dialog
>> * An error can occure here if the user cancels the log on
>> objSession.Logon()
>>endif
>>
>>on error &lcOldErr
>>
>>Any ideas??
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform