News:

Download Pelles C here: http://www.smorgasbordet.com/pellesc/

Main Menu

SendMessage problem

Started by halsten, April 29, 2008, 06:32:13 PM

Previous topic - Next topic

halsten

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);

DMac

Try this:

SendMessage(hTab, TCM_INSERTITEM, 0, (LPARAM) &ItemStruct);


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

halsten

Thanks, that worked like a charm. *thumbs up*