Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Extra libraries, Code snippets, applications etc. » C++ language problems and code snippets » THISFN and Thread (In a Thread, THISFN didn't work)
Re: THISFN and Thread [message #49643 is a reply to message #49639] Tue, 20 March 2018 23:31 Go to previous message
sisamu is currently offline  sisamu
Messages: 2
Registered: March 2018
Location: france
Junior Member
Hello Mirek,

The new code is
void testDlg::Btnexecuter()
{
	//desactivation des boutons temps du tri
	controlActif(false);

	//variables
	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, &lt, &rs, &re, &stop]
	{
		MySqlSlowLogFilter f;
		String retourFiltre;
		String fichierDestination(GetFileDirectory(fichierSource) + GetFileTitle(fichierSource) + "-filtree-" + queryTime.GetData().ToString() + "-" + lockTime.GetData().ToString() + "-" + rowsSend.GetData().ToString() + "-" + rowsExaminated.GetData().ToString() + ".log");
		retourFiltre = f.filtrerLog(fichierSource.ToStd(), fichierDestination.ToStd(), qt,lt,rs,re, stop);
		if (retourFiltre == "OK")
		{
			PromptOK(DeQtf("Traitement terminé.\nFichier disponible dans " + fichierDestination));
		}
		else
		{
			PromptOK(DeQtf(retourFiltre));	
		}
		bool p(true);
		this->controlActif(true);
	});
}

I added the equal before variables and replace THISFN by this-> and everything is going well (even variables by référence).
Great thank for your help.
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: How to set progress in taskbar button
Next Topic: UDP Server/Client with Winsock
Goto Forum:
  


Current Time: Wed Jul 16 18:09:38 CEST 2025

Total time taken to generate the page: 0.04164 seconds