|
-
Nov 25th, 2000, 07:31 PM
#1
Thread Starter
Lively Member
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
-
Nov 25th, 2000, 07:47 PM
#2
Thread Starter
Lively Member
arg!
that topic should read
unable to receive events from RUN-TIME controls.. not design time =)
-
Nov 25th, 2000, 07:56 PM
#3
Did you add the Winsock Control as a Reference?
Take a look at this thread for more.
-
Nov 25th, 2000, 08:22 PM
#4
Thread Starter
Lively Member
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 =)
-
Nov 27th, 2000, 01:41 AM
#5
Member
Dim WithEvents sckConnections() as Winsock
Using Visual Studio 6 Enterprise
---------------------------------
Everyone needs help at some point..
This time or another.
-
Nov 27th, 2000, 08:24 AM
#6
Thread Starter
Lively Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|