Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private: System::Void backgroundWorker1_DoWork_1(System::Object^ sender, System::ComponentModel::DoWorkEventArgs^ e)
- {
- while (sysActive)
- {
- if (backgroundWorker1->CancellationPending) //if it was cancelled
- {
- e->Cancel = true;
- break;
- }
- if (!sysActive) //if the progress bar value reached maximum
- {
- break;
- }
- int data = runPing();
- //backgroundWorker1->ReportProgress(0, Convert::ToString(data));
- backgroundWorker1->ReportProgress(0,data.ToString());
- Sleep(1000);
- }
- }
- void backgroundWorker1_ProgressChanged(Object^ sender,ProgressChangedEventArgs^ e)
- {
- auto textData = e->UserState;
- pingOutbox->Text = textData.ToString();
- // Not necessary. The UI will update itself if the main thread is responding.
- pingOutbox->Refresh();
- cout << "MEEP" << endl;
- }
- /*
- 1> mainGUI.cpp
- 1>i:\software stuff\c++ code\pingphuckers\pingphuckersgui\pingphuckersgui\mainGUI.h(278): error C2228: left of '.ToString' must have class/struct/union
- 1> i:\software stuff\c++ code\pingphuckers\pingphuckersgui\pingphuckersgui\mainGUI.h(278): note: type is 'System::Object ^'
- 1> i:\software stuff\c++ code\pingphuckers\pingphuckersgui\pingphuckersgui\mainGUI.h(278): note: did you intend to use '->' instead?
- ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement