Good - I found the solution after some trying and stuff :p (fail, retry, fail again, error, swear, trying, reading, failing again, fixing, waiting, evil laughing, posting the solution on CodeProject) Here is the code I have now:
public ref class Form1 : public System::Windows::Forms::Form
{
public:
System::Threading::Thread ^thd;
private: System::Void autoSave(void) {
Threading::Thread::Sleep(5000);
warningBox("Test? 5000");
runSave();
}
private: System::Void runSave(void) {
thd = gcnew System::Threading::Thread(gcnew System::Threading::ThreadStart(this, &App2::Form1::autoSave));
thd->Start();
}
private: System::Void LoadFiles(void) {
runSave();
//other code
}
Works like a charm! I started the app - and 5 second later I got this message! (warningBox(std::string msg) is a messageBox produced by the Windows::Apps thingy... :p Thnx everyone! Edit: This code keeps restarting the thread. :)
modified on Thursday, December 3, 2009 7:49 AM