Qutestion about combo box, I know I should not post this thread in this place, but...
COB_COUNTRY is the resource id of a combo box
cob_hwnd = GetDlgItem(hwnd,COB_COUNTRY);
cob_pos = (int)SendMessage(cob_hwnd,CB_GETCURSEL,0,0);
if(CB_ERR == SendDlgItemMessage
error = GetLastError();
the error code is 1400, that means invalid window handle.
In MSDN specification:
"The return value is the length of the string, in bytes, excluding the terminating null character. If the index parameter does not specify a valid index, the return value is CB_ERR. "
But I set a break point in first SendMessage statement, the cob_pos is a correct return value.
I've met this problem in many other programs, not only in combo box control, but also in other controls.