MFC creates window threads

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.