Results 1 to 4 of 4

Thread: Winsock

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2000
    Posts
    5

    Question

    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?

  2. #2
    Lively Member
    Join Date
    Mar 2000
    Posts
    87
    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.

  3. #3

    Thread Starter
    New Member
    Join Date
    Jul 2000
    Posts
    5

    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.

  4. #4
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Use

    Dim WithEvents m_wsock as Winsock

    in a class module, and see what happens.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width