: : : : int nMaxCount = sizeof(strBtnName) I tried it with GetDlgItemtext() but the program always crashes when clicking one of these buttons. : : : : If I click on a button, a dialog should open, displaying the name of the button I clicked. : : : : I have a program with 60(!) buttons at the start screen. In the new dialog (CValueDialog) in which the button text should appear, I overwrote the OnInitDialog() and inserted the function from CMyAppDlg - then my program crashes.Ĭan you post the code of your OnInitDialog()? I packed the code I wrote into a function in the class CMyAppDlg. : It seems your code gets the text from just 1 button - the code I wrote does this too without crashing. : error C2661: 'GetWindowTextA' : No overloaded function accepts 3 parameters : error C2660: 'GetWindowTextLengthA': Function doesn't accept 1 parameter : : int len = GetWindowTextLength(hItem) + 1 : : HWND hItem = GetDlgItem(hWnd, IDC_BUTTON1) : : : GetDlgItemText(IDC_disp01 /*first button with text "01" */, strBtnName, nMaxCount) : : : int nMaxCount = sizeof(strBtnName) : : : If I click on a button, a dialog should open, displaying the name of the button I clicked. : : : I have a program with 60(!) buttons at the start screen. In the new dialog (CValueDialog) in which the button text should appear, I overwrote the OnInitDialog() and inserted the function from CMyAppDlg - then my program crashes. It seems your code gets the text from just 1 button - the code I wrote does this too without crashing. : int len = GetWindowTextLength(hItem) + 1 Įrror C2660: 'GetWindowTextLengthA': Function doesn't accept 1 parameterĮrror C2661: 'GetWindowTextA' : No overloaded function accepts 3 parameters : HWND hItem = GetDlgItem(hWnd, IDC_BUTTON1) : : GetDlgItemText(IDC_disp01 /*first button with text "01" */, strBtnName, nMaxCount) : : If I click on a button, a dialog should open, displaying the name of the button I clicked. : : I have a program with 60(!) buttons at the start screen.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |