I have this code in my dialog box function:
the dialog box contains a list box and an edit box(plus some push buttons). The program compiles and links with no errors or warnings but when I run it and select the menu item which activates the dialog box I get an error message form windows saying error in kernel dll. If I remove the SetDlgItemText() The program works fine. The point of the SetDlgItemText is to initialise the edit box so it has the first string thats in the list box.Code:case WM_INITDIALOG: SendDlgItemMessage(hdwnd, IDD_LB1, LB_ADDSTRING, 0, (LPARAM)books); SendDlgItemMessage(hdwnd, IDD_LB1, LB_ADDSTRING, 0, (LPARAM)books); SendDlgItemMessage(hdwnd, IDD_LB1, LB_SETCURSEL, 0, 0); SetDlgItemText(hdwnd, IDD_EB1, books); return 1;
As a short term fix I'll just leave it out, but would like some suggestions????