Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to check that a OLE server was correctly instanciate
Message
Information générale
Forum:
Visual Basic
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00338617
Message ID:
00339319
Vues:
27
FUNCTION Init()
RETURN .F.
ENDPROC
Returning False in the Init() event in VFP will prevent the class/form from instanciating. IOW, the COM won't start. I may return False from the Init() if an error occured during startup or a required parameter/files/etc. is missing, etc.

The point is not how to make a COM work with VB, it is working now. I have a class with many properties and methods and I can use it in VB with no problem. The point is, how can I trap the case (if it occur) that the COM *didn't* start, possibly because I failed to pass a required parameter, that a file needed by the COM is not there, etc. From what I am understanding now, is that the only way of trapping this case is via an On Error redirection.

Let me ask this another way. When you instanciate a COM, do you check that it did start correctly or do you expect your On Error routine to kick in?
>«In it's initialisation event, I return False.»
>
>How do you return the value? Try not to return value. The real test I want you to do is to simply add a method to your class that will display a message box and call it from VB. Once this functionning, play with initialization!
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform