I have 2 methods in a class (login()
and change()
).
In that class I also have a property (webBrownser wb
)
I call the login()
by thread
Thread tLogin = new Thread(b.doLogin);
tLogin.SetApartmentState(ApartmentState.STA);
tLogin.Start();
and the method change()
by thread too
Thread tLike = new Thread(b.autoLike);
tLike.SetApartmentState(ApartmentState.STA);
tLike.Start();
But when the method change()
try use property wb
I receive this message:
COM object that has been separated from its underlying RCW cannot be used.
What am I doing wrong?
The methods are synchronized with lock()
...