void somefuncname::threadHandler:
{
......
enter code herestenter code hered::string tmp = std::string(buf);
beginThreadLoop();
{
std::string * data= reinterpret_cast<std::string*>(buffer.ptr());
data[0] = tmp;data[1]="";data[2]="";
pushThreadData( buffer );
}
endThreadLoop();
......
}
void somefuncname::compute
{
......
std::string* data= reinterpret_cast<std::string*>(buffer.ptr());
MGlobal::displayInfo(data[0].c_str());
......enter code here
}
一个问题:编译成功在Maya中创建新节点。当live=1时,抛出异常,Maya死了,如果我替换std::string double就没有这个问题。