I've been learning C before, but I didn't use MFC to write anything. So this is a kind of MFC's debut.
Today, I had to write a demolition tool, but the interface (edit control) was stuck when it was displayed.
So ask people everywhere, then a good friend to help me solve, thank him here.
This is always the case before the thread is added, but the program is not dead, but the control shows that the card is there.
Let the guy add a thread function, as follows:
void Ctestmfcdlg::onbnclickedbutton1 () {getdlgitemtext (Idc_edit2,url); GetDlgItemText (Idc_edit4,urlpath); AfxBeginThread (Threadproc,this); Thread Enable}uint __cdecl Ctestmfcdlg::threadproc (LPVOID lpparameter)//thread function to prevent interface from sticking {Ctestmfcdlg *ptestdlg = (ctestmfcdlg*) lpparameter;wchar_t Passfile[max_path] = {0};wchar_t Target[max_path] = {0};wchar_t Targetpath[max_path] = {0};if ( Lstrlen (ptestdlg->url) = = 0) {//afxmessagebox (L "Your not-Enter target URL");p testdlg->printf_r (l "please Enter the Target site. ");} if (lstrlen (ptestdlg->urlpath) = = 0) {//afxmessagebox ();p testdlg->printf_r (L "Please enter the site path"); lstrcpy (Target,ptestdlg->url); lstrcpy (Targetpath,ptestdlg->urlpath); lstrcpy (passfile,ptestdlg-> FileName);p testdlg->crack (target,targetpath,passfile); return TRUE;}
Here to make a record, later encountered this problem there is a way to solve.
MFC creates window threads