Hi,
Is it in dotNet possible to give a starting Thread a value on
startup??
Thread* connecttoserver = new Thread(new ThreadStart(0,
ConnectToServer));
connecttoserver->Start();
..
static void ConnectToServer(){}
^^that works fine,
but when i try to give a value to ConnectToServer it come an error
[code:1:762980b63d]
int i = 0;
Thread* connecttoserver = new Thread(new ThreadStart(0,
ConnectToServer(i)));
connecttoserver->Start();
..
static void ConnectToServer(int access){}
[/code:1:762980b63d]
thx for help
PS: i know, i can no english :P
Michiel - 11 Jun 2004 08:39 GMT
Yes for some reason this works differently than in old-school C++ :P
You have to make the variable you pass a static member of the class instead,
then it'll work.
Like
static int i;
In function
i=0;
In the thread function i has the value 0.
> Hi,
> Is it in dotNet possible to give a starting Thread a value on
[quoted text clipped - 28 lines]
> ** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
> ----------------------------------------------------------