Hi, is there something special I need to do to fill a combobox on the IDE side? Seems like using CB_ADDSTRING or even the Data field in Visual Studio has no effect. I'm trying to add the strings in WM_INITDIALOG of the dialog. SendDlgItemMessage returns 0 (not -1, error), but 0 everytime, and when I go to count the items, it is zero too!
So strange.
Filling combobox
Re: Filling combobox
I used the essentially the same .rc dialog (not MFC) for a Win32 exe and the combo box options render fine. Here's how the .rc code looks
And I call it simply using
and
Am I missing something really obvious here? Is there some initialization I need on the combo? The combo items do not show up in InstallAware when the dialog comes up - and the count of items inside is always zero.
Code: Select all
IDD_DIALOG_IDE DIALOGEX 0, 0, 316, 185
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Dialog"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
DEFPUSHBUTTON "OK",IDOK,205,164,50,14
PUSHBUTTON "Cancel",IDCANCEL,259,164,50,14
COMBOBOX IDC_COMBO1,55,62,135,72,CBS_DROPDOWN | CBS_SORT | WS_VSCROLL | WS_TABSTOP
END
IDD_DIALOG_IDE DLGINIT
BEGIN
IDC_COMBO1, 0x403, 10, 0
0x4c43, 0x4349, 0x4f4b, 0x434e, 0x0045,
IDC_COMBO1, 0x403, 8, 0
0x5250, 0x434f, 0x5345, 0x0053,
0
END
And I call it simply using
Code: Select all
HWND hwnd = (HWND)Window;
INT_PTR result = DialogBox(hInstance, MAKEINTRESOURCE(IDD_DIALOG_IDE), hwnd, dlgProc);
if (result != IDOK) return -1;
and
Code: Select all
BOOL CALLBACK dlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch (msg)
{
case WM_INITDIALOG:
{
return TRUE;
}
case WM_COMMAND:
{
switch(wParam)
{
case IDOK:
case IDCANCEL:
EndDialog(hDlg, wParam);
return TRUE;
}
break;
}
}
return FALSE;
}
Am I missing something really obvious here? Is there some initialization I need on the combo? The combo items do not show up in InstallAware when the dialog comes up - and the count of items inside is always zero.
Re: Filling combobox
My mom must have prayed.
I rebuilt my projects. The "data" field in the Properties window still doesn't work, but I was able to get my combobox options to show up using SendMessage.
I rebuilt my projects. The "data" field in the Properties window still doesn't work, but I was able to get my combobox options to show up using SendMessage.
-
- Site Admin
- Posts: 5361
- Joined: Sun Aug 22, 2010 4:28 am
Re: Filling combobox
Dear tofutim,
If you want it can be developed using MFC too.
Are you separating Items with semicolons for the data property of the ComboBox?
It should work sending the message CB_ADDSTRING during WM_INITDIALOG, are you using the correct HWND handle to the Control?
Regards
If you want it can be developed using MFC too.
Are you separating Items with semicolons for the data property of the ComboBox?
It should work sending the message CB_ADDSTRING during WM_INITDIALOG, are you using the correct HWND handle to the Control?
Regards
Francesco Toscano
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
Re: Filling combobox
I never did figure out what was wrong. Once I rebuilt it, it seemed to work (although filing in Data still doesn't work - separated by . No worries.
-
- Site Admin
- Posts: 5361
- Joined: Sun Aug 22, 2010 4:28 am
Re: Filling combobox
Dear tofutim,
the ComboBox data property doesn't work with Win32 project but with MFC project only.
Regards
the ComboBox data property doesn't work with Win32 project but with MFC project only.
Regards
Francesco Toscano
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
Return to “Plug-In Development”
Who is online
Users browsing this forum: No registered users and 27 guests