请问在c++/cli中如何调用Parallel::Invoke?帮助文件中只有c#的用法,我用cli总是通不过。哪位大大能指教一二?
------解决方案--------------------
接上边的代码
// tasktest.cpp: 主项目文件。
#include "stdafx.h"
using namespace System;
using namespace System::Threading::Tasks;
delegate void somefunc();
ref class A{
int m;
public:
A(int a):m(a)
{}
void fun1(){
Console::Write(m);
}
void fun2(){
Console::Write(m);
}
};
int main(array<System::String ^> ^args)
{
A^ a1 = gcnew A(10);
A^ a2 = gcnew A(100);
Action ^s1 = gcnew Action(a1,&A::fun1);
Action ^s2 = gcnew Action(a2,&A::fun2);
Parallel::Invoke(s1,s2);
Console::WriteLine(L"Hello World");
return 0;
}