I am writing an MFC program in Visual Studio 2013 and i keep getting the two following errors
Error C2893 Failed to specialize function template 'unknown-type std::invoke(_Callable &&,_Types &&...)'
and
Error C2672 'std::invoke': no matching overloaded function found
The error is related to file xthread line 238
I am fairly new at c++/MFC and I am trying to write a function that will run in the background to the system time.
This is the code i am using:
void task1(ExperimentTab& dlg)
{
while (true)
{
CString showtime = CTime::GetCurrentTime().Format("%H:%M:%S");
int x = dlg.m_showTime.GetWindowTextLengthA();
dlg.m_showTime.SetWindowTextA(_T(""));
dlg.m_showTime.ReplaceSel(showtime, 0);
}
}
void mainThread()
{
std::thread t1(task1);
t1.join();
}
This is then being called on a button press to start the time, but the same button is used to also stop the time.