My project is a MFC dialog. There is a "Installation" button. Users can click this button to start a download and to automatically exectue the installation after download finished.
I have already fulfilled the download part -- in a std::thread. When users click the "Installation" button, it would prompt a progress bar, it's actually is another CDailog - It's called CMyProgressBar.
CMyProgressBar has a member m_thDownload.
void CMyProgressBar::DoDataExchange(CDataExchange* pDX)
{
m_thDownload = std::thread(funDownload);
}
Here m_thDownload can do the download thing. After the download, I need a thread to execute the installation. I don't want to add another thread member, and actually I don't have to add another thread according to logic.
So, where do I put the starting installation code? and it can execute immediately after the download?
Aucun commentaire:
Enregistrer un commentaire