Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Disabling activex control in form
Message
From
14/11/2001 15:12:41
 
 
To
14/11/2001 13:11:52
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00581654
Message ID:
00581738
Views:
31
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?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform