Home » Extra libraries, Code snippets, applications etc. » C++ language problems and code snippets » THISFN and Thread (In a Thread, THISFN didn't work)
THISFN and Thread [message #49625] |
Sun, 18 March 2018 09:38 |
sisamu
Messages: 2 Registered: March 2018 Location: france
|
Junior Member |
|
|
Hello,
I'm new in using CPP.
I made this function and i don't know how to call a function of the main in my thread. I have tried THISFN but it didn't work.
I have a compilation error with the last line "'this' was not captured for this lambda function".
If i remove the last line, the program works well.
My code :
void testDlg::Btnexecuter()
{
//desactivation des boutons temps du tri
controlActif(false);
double qt( queryTime.GetData()), lt(lockTime.GetData()), rs(rowsSend.GetData()), re(rowsExaminated.GetData());
String fichierSource(btnFichier.GetLabel());
//Thread pour ne pas bloquer interface graphique
t.Run([&stop, &fichierSource, &qt, <, &rs, &re]
{
MySqlSlowLogFilter f;
String retourFiltre;
String fichierDestination(GetFileDirectory(fichierSource) + GetFileTitle(fichierSource) + "-filtree.log");
retourFiltre = f.filtrerLog(fichierSource.ToStd(), fichierDestination.ToStd(), qt,lt,rs,re);
if (retourFiltre == "OK")
{
PromptOK(DeQtf("Traitement terminé.\nFichier disponible dans " + fichierDestination));
}
else
{
PromptOK(DeQtf(retourFiltre));
}
THISFN(testDlg::controlActif(true));
});
}
Thank you for your help.
[Updated on: Sun, 18 March 2018 12:02] by Moderator Report message to a moderator
|
|
|
Goto Forum:
Current Time: Thu Apr 25 16:55:51 CEST 2024
Total time taken to generate the page: 0.02595 seconds
|