Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Subclassing MSComm Control
Message
De
18/07/2000 13:37:50
Gregg Geeslin
Kwajalein Range Services
Apo, Californie, États-Unis
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Divers
Thread ID:
00393493
Message ID:
00393926
Vues:
18
Hi Tom, Larry,

I played around with this control a bit yesterday. The only way I could get it to run for me was to drop it on a form. I didn't have any luck doing an AddObject() or NewObject() after the form was instantiated. I didn't have any luck with _Screen.AddObject(), either. I dragged it off the Forms Control menu onto an empty form and it worked fine. I was able to save the form with the MSComm object on it as a class and then instantiating it from a command line. Using the Class Browser to view the code, the code looked like this:

**************************************************
*-- Class: temp (c:\temp\temp1.vcx)
*-- BaseClass: form
*-- Time Stamp: 07/18/2000 12:12:07 PM
*
DEFINE CLASS temp AS form


AutoCenter = .T.
Visible = .T.
LockScreen = .F.
Name = "Form1"


ADD OBJECT olecontrol1 AS olecontrol WITH ;
Top = 0, ;
Left = 0, ;
Height = 100, ;
Width = 100, ;
Visible = .F., ;
Name = "Olecontrol1"


ENDDEFINE
*
*-- EndDefine: temp
**************************************************

* I took this code above and saved it to temp.prg, then
SET PROCEDURE TO Temp.prg ADDITIVE
x = NEWOBJECT('Temp')
*
* Here a funky looking dialog came up.
* I selected 'Insert Control', picked the Communications Control and
x.Show()
* And there was the form.
?x.controls[1].name
?x.controls[1].baseclass
*
Perhaps you missed seeing an Add Object command in your example's parent class?
I'll have to play around with this some more later. I'd like to know how to do this programmatically.

HTH,

Gregg
gregg@wsacorp.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform