How to pass character arrays as parameters to a Thread^

Hi,

I'm using C++ and I want to start a thread calling a function (extractVoice) that has char* as two parameters. Below is my code:

Thread^ extractVoiceThread = gcnew Thread(gcnew ParameterizedThreadStart(this, &MainWindow::extractVoice));
extractVoiceThread->Start(filepathV, file);

void ConEmRecog::MainWindow::extractVoice(char* filepath, char* filename){
}

However, the parameter can only one and of type System ^ Object. In my case I need to pass two character arrays. Any ideas how this can be done?

Thank you very much!
Hi ! If void ConEmRecog::MainWindow::extractVoice is a custom function I highly recommend using std::string or the like as parameters since this is c++ ;)

To answer your question:
1
2
3
4
char *filepath = new char;
filepath = "C:\\myprogram\\";
//...use filepath 
delete filepath;
Last edited on
This is not the right forum to post your C++/CLI and .NET questions, try windows forum, or even better, @MSDN forums, as here almost nobody uses that language.
Topic archived. No new replies allowed.