Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Disabling activex control in form
Message
De
14/11/2001 15:12:41
 
 
À
14/11/2001 13:11:52
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00581654
Message ID:
00581738
Vues:
32
You can do the following in any method in your form, you can check whether it is instanciated or not. Note that "MSCommLib.MSComm" is the CLSID for the ActiveX you can easily see it in the properties window at OleClass, often it ends with a 'dot and number' but this is to indicate just the version. You can ignore it.


Thisform.AddProperty( "oo", .NULL.) && Create form property
lcOnError= On( "Error")
On Error * Do nothing
Thisform.oo= CreateObject("MSCommLib.MSComm")
On Error &lcOnError
If IsNull( Thisform.oo)
** Object didn't instanciate
** Here goes your own code
EndIf



>I added an MSCOMM control to form in form designer.
>I need that this control will not be created this control in not present on the user's computer.
>
>Is it sufficient to add
>
>RETURN .F.
>
>to init event of activex control in form to prevent error if this control is not present in user's computer ?
>
>I cannot test it in my computer since it is not possible to unregister mscomm control.
>regrvr32 /u shows success but if I run the form, the control is registered automatically. Why?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform