Results 1 to 7 of 7

Thread: Winsock - using it without putting the control on the form

  1. #1

    Thread Starter
    Hyperactive Member Krass's Avatar
    Join Date
    Aug 2000
    Location
    Montreal
    Posts
    489
    I would like to know if it's possible to use a Winsock control without putting it on the form. I tried the following:

    Public wskConnection As Winsock

    Then I would normally use wskConnection, but I get an error as soon as I try to access one of its properties (Object vairable or with block variable not set).

    Is there a solution to this? Thanks.
    Chris

  2. #2
    Fanatic Member
    Join Date
    Jul 2000
    Location
    Manchester NH
    Posts
    833
    I had this in my notes... its the best I can do
    I is for formless creation of the MScomm control
    Figure it will get you pointed in the right direction



    dim C1 as Object

    set C1 = CreateObject("MSCommLib.MSComm")



    Kurt Simons
    [I know I'm a hack but my clients don't!]

  3. #3
    Addicted Member
    Join Date
    Oct 2000
    Location
    Vienna/Austria
    Posts
    132
    Hi !!!

    If you using VB6 (VB5 i didn't know), set a reference to the MSWINSCK.OCX

    don't forget to catch the events

    Private WithEvents wskConnection As Winsock

    and initialize the winsock with new

    Set wskConnection = New Winsock


    cu

  4. #4
    PowerPoster Fox's Avatar
    Join Date
    Jan 2000
    Location
    *afk*
    Posts
    2,088
    > Set wskConnection = New Winsock

    i think that wouldnt work...

  5. #5
    Addicted Member
    Join Date
    Oct 2000
    Location
    Vienna/Austria
    Posts
    132
    Hi Fox !!!

    Believe me, it works. if you want an example reply.

    -cu TheOnly

  6. #6
    PowerPoster Fox's Avatar
    Join Date
    Jan 2000
    Location
    *afk*
    Posts
    2,088
    Yes please, Im currently trying this and it just doesnt work...

  7. #7

    Thread Starter
    Hyperactive Member Krass's Avatar
    Join Date
    Aug 2000
    Location
    Montreal
    Posts
    489

    What do you guys do with Winsock?

    I am currently having some problems with Winsock, maybe one of you guys can help me out.

    I copied some code from the forum that showed how to use the Winsock control. It was using 2 winsock controls. If I remember right one of them was for LISTENING and the other one for the data connection (downloading, uploading, etc). Is this necessary? (using 2 winsock control)

    Also, I have been able to download a 90bytes text file straight to a variable, but when I try downloading a 247kb file to the hard disk, it downloads from 220kb to 240kb and never finish the file succesfully.

    If you are using the winsock, like me, to download a binary file from an ftp site, please give me some code example, I really need it!

    I posted the following thread regarding this problem: http://forums.vb-world.net/showthrea...threadid=34730

    Thank you very much
    Chris

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