У меня проблема с моим кодом. У меня есть 2 классов:Изменить атрибут потока из другого класса
- clsSMS
- clsWorker
Когда моя нить работает, я хочу изменить атрибут из них из моего класса clsSMS.
public class clsSMS
{
clsWorker objclsWorker;
public clsSMS(clsWorker objclsWorker = null)
{
this.objclsWorker.operatorBlocageError38();
// The above call doesn't work...
// I think the objclsWorker is always null...
// What do you think?
}
}
public class clsWorker
{
public clsSMS clsobjSMS;
public clsWorker(...)
{
this.clsobjSMS = new clsSMS(objclsWorker: this);
}
public void operatorBlocageError38(/*String port_concerne, bool erreur38*/)
{
MessageBox.Show("The method call work fine!");
}
}
Почему у вас есть 'cls' перед всеми вашими классами? – asawyer