T
TommyB
Hi NG,
first of all sry about my english maybe it's somethin' funny to you
Following situation:
I've a structure like this:
Structure _Test
Dim IP as String
Dim UserLogin as String
End Structure
Dim Test() as _Test
This should keep the given information in an array, where each array-item is
used for one ip in local network.
In the main code the structure goes initialized like this:
Redim Test(2)
Test(0) = New _Test
Test(1) = New _Test
Test(2) = New _Test
Test(0).IP = "192.168.0.1"
Test(1).IP = "192.168.0.10"
Test(2).IP = "192.168.0.100"
Now I'll move my structure through a function.
Test = ProcessStruct(Test)
This structure does the following:
It calls for each item another function, witch is processing the ip and gets
back the Username. This is written in the structure. On End the actualized
structure is returning.
And all works fine, but:
When I want to scan the complete subnet-range (ie 192.168.0.x) it could hang
my program up to 4sec per ip, when function gets timeout.
Now I want to use threads, but I've no idea how to passing the structure
through the thread.
I think it must be possible, that the main function calls the 2nd function
(witch retrive information) all 100ms (for example) with the next ip. The
main function should gets the returned information and assemble it to the
structure.
But how to do it? I tried with events, but withevents wont work with arrays.
Now I'm confused and need help or other examples, how to do it better, than
I thougt.
Thanks and please help!
first of all sry about my english maybe it's somethin' funny to you
Following situation:
I've a structure like this:
Structure _Test
Dim IP as String
Dim UserLogin as String
End Structure
Dim Test() as _Test
This should keep the given information in an array, where each array-item is
used for one ip in local network.
In the main code the structure goes initialized like this:
Redim Test(2)
Test(0) = New _Test
Test(1) = New _Test
Test(2) = New _Test
Test(0).IP = "192.168.0.1"
Test(1).IP = "192.168.0.10"
Test(2).IP = "192.168.0.100"
Now I'll move my structure through a function.
Test = ProcessStruct(Test)
This structure does the following:
It calls for each item another function, witch is processing the ip and gets
back the Username. This is written in the structure. On End the actualized
structure is returning.
And all works fine, but:
When I want to scan the complete subnet-range (ie 192.168.0.x) it could hang
my program up to 4sec per ip, when function gets timeout.
Now I want to use threads, but I've no idea how to passing the structure
through the thread.
I think it must be possible, that the main function calls the 2nd function
(witch retrive information) all 100ms (for example) with the next ip. The
main function should gets the returned information and assemble it to the
structure.
But how to do it? I tried with events, but withevents wont work with arrays.
Now I'm confused and need help or other examples, how to do it better, than
I thougt.
Thanks and please help!