Pelles C forum
C language => Expert questions => Topic started by: halsten on April 29, 2008, 06:32:13 PM
-
I am using a Tab control in my project, that I recently wrote in MASM. However a part with the SendMessage API does not want to compile and generate the following output.
error #2140: Type error in argument 4 to 'function'; found 'TCITEMA', expected 'long int'.
Here's a snippet of what I have written so far.
[...]
HWND hTab;
TC_ITEM ItemStruct;
HWND hDlgLog;
[...]
case WM_INITDIALOG:
hTab = GetDlgItem(hwndDlg, IDC_TAB);
ItemStruct.mask = TCIF_TEXT;
ItemStruct.pszText = "Log";
SendMessage(hTab, TCM_INSERTITEM, 0, ItemStruct);
-
Try this:
SendMessage(hTab, TCM_INSERTITEM, 0, (LPARAM) &ItemStruct);
Regards,
DMac
-
Thanks, that worked like a charm. *thumbs up*