I need to create a thread in a managed C++ code (CLR) to call an unmanaged C++ class member function passing a std::string
as a parameter. The thread is being called, but the received std::string
is being received as an empty string:
The managed code:
std::string param;
CreateThread(0, NULL, (LPTHREAD_START_ROUTINE) &MyThread.Start, &MyThread, (DWORD) ¶m, NULL);
The unmanaged code:
class MyThread
{
public:
MyThread();
static void Start(std::string ¶m);
};
void MyThread::Start(std::string ¶m)
{
std::cout << param << std::endl; <<=== param is empty here
}
Aucun commentaire:
Enregistrer un commentaire