Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Subclassing
Message
 
À
05/07/2000 15:11:39
Information générale
Forum:
Visual Basic
Catégorie:
Autre
Titre:
Divers
Thread ID:
00388406
Message ID:
00388796
Vues:
7
You won't use createobject, you'd DIM Object WithEvents, then Set x = New Object. See the help file on withevents for good examples.
That isn't called subclassing however, but if it accomplishes your goals thats all that matters.

BTW, avoid using CreateObject(), since the compiler cannot bind the object at compile time (this is called late binding). When you
DIM the object, the compiler can optimize objects for speed many times more than late binding.

HTH,
Ed



>If an object is created in a class using createobject() how can I add custom code to respond to events. For example the SendComplete event of the WinSock control. I want to create an instance of the winsock control in my class using createobject("MSWinsock.Winsock"). The I want to write a piece of code that runs when the SendComplete event fires. Is this possible with VB?
>
>>VB7 supposedly supports sub-classing, VB6 does not natively. VB6's implementation relies on hooking into the windows
>>message pump, which is tempermental at best, and only for the stone hearted.
>>
>>>Can someone give me the basics on how to subclass the timer control (or any native control or Active X control) in VB?
>>>
>>>Thanks,
>>>David
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform