Results 1 to 6 of 6

Thread: unable to receive events from design-time controls

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 1999
    Location
    Phoenix
    Posts
    87

    unable to receive events from run time created controls

    this is no winsock control on my form (because there is no form =) this is in a class module i wish to eventually get into a DLL)

    this is in my code

    Dim sckConnections() as Winsock

    i need to allocate/deallocate connections on the fly. I am unable to receive events to get this working.

    What am i missing?

    thanks a bunch

  2. #2

    Thread Starter
    Lively Member
    Join Date
    Jul 1999
    Location
    Phoenix
    Posts
    87

    arg!

    that topic should read

    unable to receive events from RUN-TIME controls.. not design time =)

  3. #3
    Guest
    Did you add the Winsock Control as a Reference?
    Take a look at this thread for more.

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Jul 1999
    Location
    Phoenix
    Posts
    87

    sure did

    yeah its added as a reference.. i'll provide a little more info into what im trying to do...

    i have a form with 1 winsock control placed on it at design time (sckListen). Its sole purpose is to listen for incoming connections. When the ConnectionRequest event fires, I call a method which dynamically resizes my sckConnections() array (increases array size by 1) and accepts the connection

    im doing something like

    Code:
    newSocket = ubound(sckConnections())+1
    redim preserve sckConnections(newSocket)
    sckConnection.accept requestID
    i'm resizing the array to hold another winsock control. But I am not doing a Load sckConnection(newSocket).. hmm i wonder if thats the problem..

    anywho.. i can accept a bunch of connections but when one disconnects i'm unable to grab the sckConnections_close event.. it's just not firing...

    back to the drawing board...

    thanks =)

  5. #5
    Dim WithEvents sckConnections() as Winsock

    Using Visual Studio 6 Enterprise
    ---------------------------------
    Everyone needs help at some point..
    This time or another.

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Jul 1999
    Location
    Phoenix
    Posts
    87

    you can't use WithEvents on arrays =(

    i tried doing

    Code:
    Dim WithEvents sckConnections() as Winsock
    and it didn't work.. this is from the VB help...

    WithEvents
    Optional.Keyword that specifies that varname is anobject variable used to respond to events triggered by an ActiveX object. WithEvents is valid only in class modules. You can declare as many individual variables as you like using WithEvents, but you can't create arrays with WithEvents. You can't use New with WithEvents.

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