Bonjour,
j'ai déja lu pas mal de materiel la dessus, ca a l'air de marcher chez tout le monde sauf chez moi, quelqu'un aurait une explication:
Dans ma winform j'ai cela :
On me dit qu'il faut plus d'un argument a ThreadStart alors qu'il exise un constructeur avec un argument...Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 public: System::Void startClock() { int i=0; while(1) { { Thread::Sleep(1); DateSim->Text = i.ToString(); DateSim->Refresh(); i = i + 1; } } private: System::Void OK_Click(System::Object^ sender, System::EventArgs^ e) { //Start the Req Generation in a new Thread Threading::ThreadStart^ entry = gcnew System::Threading::ThreadStart(startClock); Threading::Thread^ threadReqGen = gcnew System::Threading::Thread(entry); threadReqGen->Start(); }
Sinon j ai essayer de preciser comme ceci
Threading::ThreadStart^ entry = gcnew System::Threading::ThreadStart(GUISim::Form1,GUISim::Form1::startClock);
Mais bon fonctionne pas car le premier argument doit être un objet. Bref je suis un peu perdu, quelqu'un pourrait il me montrer la voie de sorti.
Merci bien
Tom