调用窗口类的成员函数
.h文件中声明如下:
public:
VOID test(TCHAR* str);
.cpp文件中内容如下:
#include <thread>
using namespace std;
void CMFCApplication2Dlg::OnBnClickedButton6()
{
TCHAR * p = _T("hello world");
std::thread t(&CMFCApplication2Dlg::test, this, p);
t.join();
}
VOID CMFCApplication2Dlg::test(TCHAR* str)
{
AfxMessageBox(str);
}
VC++2015编译
转载于:https://blog.51cto.com/9233403/2151445