Advertisement
Guest User

Untitled

a guest
Feb 6th, 2016
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.31 KB | None | 0 0
  1. private: System::Void backgroundWorker1_DoWork_1(System::Object^ sender, System::ComponentModel::DoWorkEventArgs^ e)
  2. {
  3. while (sysActive)
  4. {
  5. if (backgroundWorker1->CancellationPending) //if it was cancelled
  6. {
  7. e->Cancel = true;
  8. break;
  9. }
  10. if (!sysActive) //if the progress bar value reached maximum
  11. {
  12. break;
  13. }
  14.  
  15. int data = runPing();
  16. //backgroundWorker1->ReportProgress(0, Convert::ToString(data));
  17. backgroundWorker1->ReportProgress(0,data.ToString());
  18. Sleep(1000);
  19. }
  20. }
  21. void backgroundWorker1_ProgressChanged(Object^ sender,ProgressChangedEventArgs^ e)
  22. {
  23. auto textData = e->UserState;
  24. pingOutbox->Text = textData.ToString();
  25. // Not necessary. The UI will update itself if the main thread is responding.
  26. pingOutbox->Refresh();
  27. cout << "MEEP" << endl;
  28. }
  29.  
  30.  
  31.  
  32.  
  33. /*
  34. 1> mainGUI.cpp
  35. 1>i:\software stuff\c++ code\pingphuckers\pingphuckersgui\pingphuckersgui\mainGUI.h(278): error C2228: left of '.ToString' must have class/struct/union
  36. 1> i:\software stuff\c++ code\pingphuckers\pingphuckersgui\pingphuckersgui\mainGUI.h(278): note: type is 'System::Object ^'
  37. 1> i:\software stuff\c++ code\pingphuckers\pingphuckersgui\pingphuckersgui\mainGUI.h(278): note: did you intend to use '->' instead?
  38. ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
  39. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement