Code that shows "Please Wait" Message while doing a lengthy operation (ERROR C2440)

Hi,

I have very basic knowledge of C++ and I don't understand completely how this works. I have been trying to use pthreads in order to be able to show a "Please Wait" Dialog while performing a lengthy operation. I have tried the code below but I am getting the following error: error C2440: 'type cast' : cannot convert from 'RCM::Processing ^' to 'void *'. Could you please modify the following code so that the program does what I am looking for without errors? (note that I have pasted the sections of the program I think are useful for someone to provide an answer).

void *run_optimization( void ^ptr );
void *run_optimization( void ^ptr )

{

Processing^ Proc = (Processing ^)ptr;
Solution x = Optimizer(); // Lengthy operation
const int * const SolArray = x.getDiscreteSolution();
Proc->Close();
return 0;
}
namespace RCM {
private: System::Void button2_Click(System::Object^ sender, System::EventArgs^ e) {
Processing^ Proc = gcnew Processing();
pthread_t thread1;
int ret1;
ret1 = pthread_create( &thread1, NULL, run_optimization, (void *)Proc);
Proc->Show(); // this is the "Please Wait" Dialog
}

}

Thank you!!!
morning,
Are you aware that code isn't pure C++?

http://en.wikipedia.org/wiki/C%2B%2B/CLI

Topic archived. No new replies allowed.