invalid conversion from `int'

Hi there
for some reason i am getting this error when I try to compile my code:

55 C:\Documents and Settings\Timbo\My Documents\C++\Map and Load Updater\GUI\main.cpp invalid conversion from `int' to `HWND__*'

I know it is to do with this bit of code and I just can't find a solution anywhere.

1
2
3
4
5
6
7
8
9
10
11
12
13
case IDC_UPDATE:
                     {      
                            char filename[80];
                            char mapname[80];
                            char maptype[80];
                            char nIndex = SendMessage( hwnd, CB_GETCURSEL, 0, 0 );
                            
                            //Update the file
                            GetDlgItemText(hwnd, IDC_TEXT, filename, 80);
                            GetDlgItemText(hwnd, IDC_TEXT1, mapname, 80);
                            SendMessage(IDC_COMBO, CB_GETLBTEXT, (WPARAM)nIndex, (LPARAM)maptype);
                     }
                     break;


Any help would be greatly appreciated.

Thanks in advance.

Timbo1
I assume IDC_COMBO is an integer, while SendMessage asks you for a HWND.
So how do I fix it as i am trying to get a selection from a combo box?

It is defined like that:

#define IDC_COMBO 1003

it is mentioned here

cboGame = GetDlgItem(hwnd, IDC_COMBO);

Last edited on
Line 11 must be
SendDlgItemMessage(hwnd,IDC_COMBO, CB_GETLBTEXT, (WPARAM)nIndex, (LPARAM)maptype);
or
SendMessage(GetDlgItem(hwnd, IDC_COMBO), CB_GETLBTEXT, (WPARAM)nIndex, (LPARAM)maptype);
Thanks, could not find this anywhere on google
Topic archived. No new replies allowed.