Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
MSWinsock
Message
De
30/11/1999 12:03:18
 
 
À
30/11/1999 11:11:30
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Titre:
Divers
Thread ID:
00296895
Message ID:
00296926
Vues:
28
>>I have been using a MSWinsock control on a form in an application and now wish to using it in a program and want to put code in the dataarrival event. I have tried the following but it does not work I get an error that says 'Object class is invalid for this container.'
>>
>
>That message usually indicates that you tried to add an OleCOntrol somewhere that didn't like it (like to _screen).
>
>In order to respond to events, you're going to have to create a custom class that will provide VFP code to hook into the Winsock control's events, and bind the custom class to the Winsock ActiveX control (NOT the OleControl that sits on the form!) using VFPCOM, an add-on that, among other things, can examine the available events for an ActiveX control and produce a template .PRG that can be used as a starting point for writing the custom class, and bind the events of an ActiveX control to correspondingly-named methods of an instance of the custom class.

Thanks for the response Ed. I have changed my mind and decided to subclass a form and add the Winsock control to the form in the class designer. I did this and used creatobject to create and instance of the new form class. However the DataArrival event does not seem to fire. Have I done something wrong or does your above explanation apply in this case also?

Thanks for the help.
>>David
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform