Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to check that a OLE server was correctly instanciate
Message
De
29/02/2000 13:53:57
 
 
À
29/02/2000 11:23:36
Information générale
Forum:
Visual Basic
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00338617
Message ID:
00339330
Vues:
37
Hi Ed,

I wanted to know if there is another way of checking that the COM did instanciate correctly.

My COM is built in VFP. In it's Init() event, I may return .F. if something is wrong. Like you know, this will prevent the COM from instanciating. In VFP, I would write this code:
loCOM = NewObject("MyCOM.MyClass")
IF VarType(loCOM) = "O"
   *-- Use loCOM here
ELSE
   *-- Display error message
ENDIF
I was wandering if there is a similar approach in VB. In my test, if my COM return .F. in it's Init() event, VB throw an error on the line:

Set loCOM = New MyCOM.MyClass

Is there another way than using On Error in this case?

TIA
>My guess is that it's how he's handling errors in VB; ordinarily I'd trap the failed instantiation by wrapping the SET in an in-line error handler, but I'm far from a VB expert.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform