Home > Back-end >  SetDlgItemText lead to crash
SetDlgItemText lead to crash

Time:09-24

Edit control are defined as follows:
CONTROL ", "IDC_ROBOT_STATUS," Edit ", ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP, 145, 180, 100, 15
Once the content of the changes in the program editor, it will crash, such as add the following statement: in Dialog_Main_OnInitDialog
1. SetDlgItemText (DlgHwnd IDC_ROBOT_STATUS, Status);
2. Strcpy (Status, "test");
3. SetDlgItemText (DlgHwnd IDC_ROBOT_STATUS, Status);

If you delete the 2, 3 words no problem

Would like to ask each master, this is how to return a responsibility?


CodePudding user response:

How do the Status you define and initialize?
  • Related