Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to detect a 'dead' object
Message
De
11/01/1999 11:17:36
 
 
À
11/01/1999 11:11:23
Steve Goss
Aon Group Limited
London, Royaume Uni
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00174663
Message ID:
00174667
Vues:
29
>>>Hello
>>>
>>>Within our system we have a VFP exe and a VB exe which share a common object. We create a reference to this object using the CREATEOBJECT() command.
>>>
>>>We have encountered the scenario where an error has occurred in VB which has resulted in the object being 'killed'. When we subsequently attempt to reference the object in VFP we get an OLE error - RPC server is not available.
>>>
>>>Is there any way of determing whether an object is OK prior to using it's properties or methods?
>>
>>Basically, it's error trapping issue. Also, you can check TYPE("oApp.oMyobject") any time before you use it, but I guess it will not give 100% reliable responce.
>>
>>It's actually within the error handler that we are encountering the problem. If the object doen't exist then I can bypass some code and terminate the application cleanly. I've tried the TYPE() command but it comes back with a value of O whether the object exists or not.

Could you also check for: TYPE("oMyobject")<>"O" OR ISNULL(oMyobject)? Also, not that you may trap any error and still terminate the application.
Edward Pikman
Independent Consultant
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform