I am not sure if I quite understood what you are saying. Actaully I create the dialog using CreataIndirect which is the member of CDialog class. Secondly, the combobox that I created using the DLGITEMTEMPLATE * is displayed when I run the program but when I use GetDlgItem(IDC_COMBO) it returns NULL as if the combobox does not exits. So could you please tell me how can I add items to this combobox. Regards, Atif
Atif Hashmi
Posts
-
Adding entries to ComboBox created using DLGITEMTEMPLATE * -
Adding entries to ComboBox created using DLGITEMTEMPLATE *hi douglas, Thanks a lot for sending me the link. I tried to send message to the combobox but it is not working. Let me explainn the problem a bit more. I have a DLGTEMPLATE * dialog, using this structure I create a dialog. then I use CreateIndirect of CDialog to create this dialog in memory. I add different controls to this dialog and each control is DLGITEMTEMPLATE *. I create a DLGTEMPLATEITEM* combobox and create it in memory. Now, when I do CWnD::GetDlgItem(IDC_COMBOBOX) it returns NULL. Could you please tell me what I am doing wrong or what the problem is. I tried the following code HWND combo_box_handle = 0; combo_box_handle = GetDlgItem(COMBOBOX_ID); SendMessage(combo_box_handle, CB_ADDSTRING, 0,(LPARAM)"One"); Thanks and regards, Atif Gul Hashmi
-
Adding entries to ComboBox created using DLGITEMTEMPLATE *Hi, I have created a ComboBox using DLGITEMTEMPLATE * and now, I want to add entries to this combobox. I could not have managed to figure out how to do this. Could nay body please help me out. Regards, ATif Gul