-
I am building a system that uses the Winsock control for net comms, but may want to use other controls for subsequent releases. Because of this, I would like to build a "shell" class around the Winsock control, so that if I later decide to use some other control, I can make all of my changes in the "shell" class only.
The problem is, I can't figure out how to reference the Winsock control in a class. I can Dim a variable as Winsock, but cannot reference that variable without a runtime error. Is there something I am missing?
-
Ive tried instancing a winsock control at runtime and I cant get it to work either. Tried lots of different way. I dont think you can do it. You can only set your class level winsock object to one that is already on a form.
-
Winsock
Thanks for the information...that is the conclusion I have reached also. So, if I include my winsock "shell" class module in some VB project, then I must separately include the .frm file where the winsock control resides? Not exactly what I wanted.
-
Use
Dim WithEvents m_wsock as Winsock
in a class module, and see what happens.