NO

Author Topic: SendMessage problem  (Read 3916 times)

halsten

  • Guest
SendMessage problem
« 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.

Code: [Select]
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.

Code: [Select]
        [...]
        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);

Offline DMac

  • Member
  • *
  • Posts: 272
Re: SendMessage problem
« Reply #1 on: April 29, 2008, 07:48:01 PM »
Try this:

Code: [Select]
SendMessage(hTab, TCM_INSERTITEM, 0, (LPARAM) &ItemStruct);

Regards,
DMac
No one cares how much you know,
until they know how much you care.

halsten

  • Guest
Re: SendMessage problem
« Reply #2 on: April 29, 2008, 11:30:34 PM »
Thanks, that worked like a charm. *thumbs up*