Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Error handling and kill with COM
Message
 
À
08/07/2004 15:44:18
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00920870
Message ID:
00922206
Vues:
18
Your approach certainly seems solid, simple and to the point. It may not be "tight", but it works! Sometimes simplicity trumps elogence:-)


>Hi Terry,
>
>I was unable to figure how to use COMRETURNERROR to have app 2 not ask for data if the network was down, BUT, what I did amounts to the same thing. I check for a directory on the server (IF DIRECTORY('dir on the server')), and if not there, I inform the user, network is down...
>
>Truth is that really isn't tight enough. Even if the network were tehre it could go down while asking for the data so I did the following:
>
>Keep up with whether or not com object exists (LCom_Exists would be true when com is created)
>
>I have a global variable (LInComCode), for telling my error handler when I am in any code that accesses COM. I set this true above any line that accesses COM and false immediately afterward.
>
>In error handler, If LInComCode just return
>
>Below each line that accesses the COM object I check for an error. If one occurs, I kill the com object and set LCom_Exists false.
>
>Anytime I need the com object, if LCom_Exists is false, I recreate it.
>
>I know it is ridiculously complex but it will work and is working well in testing.
>
>Thanks for the input,
>John
Imagination is more important than knowledge
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform