views:

32

answers:

1

Trying to dim a certain amount of process (determined by Environment.ProcessorCount) to run several processes which do not support multi-threading. I have already Dim'd proinf(6) as Process.ProcessStartInfo because I have designed a queue for the processes and this encounters no errors.

Any help is appreciated!

A: 

Is this what you are after?

Dim parray(Environment.ProcessorCount) As Process
For i As Integer = 0 To parray.Length - 1
  parray(i) = New Process()
Next
Brian Gideon
Well this works first off and Visual Studio Accepts and compiles the code, but I get an error when I use:For counter = 1 To Environment.ProcessorCount Process.star(counter)NextThe error is:Object reference not set to an instance of an object.When I run through Debug in VS, it says to include "New" in the declaration, but you can't use arrays and "New" together apparently.
Yiu Korochko
I updated my answer to include the `For` loop that is required to instantiate the `Process` objects in the array.
Brian Gideon