Hi,

I'm learning how to use the windows common controls in VC++.

I'm starting with the ComboBoxEx control.

The main window work fine and I just put in the code to create the combo box from MSDN. However, I'm getting the following error when compiling:

error C2664: 'CreateWindowExA' : cannot convert parameter 9 from 'void *' to 'struct HWND__ *'
Conversion from 'void*' to pointer to non-'void' requires an explicit cast

Parameter 9 is the handle to the main window. I declared a global variable as: HANDLE ghWndMain and after I call the ShowWindow function, I set the variable as: ghWndMain = hWnd which should set it to the Main window's handle, right?

But for some reason, the CreateWindowEx function inside the ComboBoxEx function doesn't like that handle. Here is the code for the ComboBox:

Code:
HWND WINAPI CreateComboEx(void)
{

	HWND hWnd;
	INITCOMMONCONTROLSEX icex;

	icex.dwSize =	sizeof(INITCOMMONCONTROLSEX);
	icex.dwICC =	ICC_USEREX_CLASSES;

	InitCommonControlsEx(&icex);

	hWnd = CreateWindowEx(0,WC_COMBOBOXEX,NULL,
						WS_BORDER|WS_VISIBLE|WS_CHILD|CBS_DROPDOWN,
						// No size yet -- resize after setting image list
						0,	// Vertical position of Combobox
						0,	// Horizontal position of Combobox
						0,	// Sets the width of Combobox
						100,	// Sets the height of Combobox
						ghWndMain,
						NULL,
						ghInstance,
						NULL);
	return(hWnd);
}
Any help would be appreciated..

Dan