|
From: Carlos d. M. <cg...@wo...> - 2002-09-27 16:15:43
|
You must link with the libraries (-lcomctl32). If you need some other,
see at your lib dir.
Vlada Djurovic escribi=F3:
> H!
>
> I want to add a toolbar to my window,so I included <windows.h> and
> <commctrl.h>, but I keep getting following messages:
>
> 173 C:\Visual\Test1\main.cpp
>
> `INITCOMMONCONTROLSEX' undeclared (first use this function)
>
> 173 C:\Visual\Test1\main.cpp
>
> parse error before `;'
>
> 174 C:\Visual\Test1\main.cpp
>
> `icex' undeclared (first use this function)
>
> 176 C:\Visual\Test1\main.cpp
>
> implicit declaration of function `int InitCommonControlsEx(...)'
>
> here=92s the code:
>
> case WM_CREATE:
>
> {
>
> TBBUTTON tbButtons[]=3D
>
> {(STD_FILENEW,ID_FILE_NEW,TBSTATE_ENABLED,TBSTYLE_BUTTON,0L,0),
>
> (STD_FILEOPEN,ID_FILE_OPEN,TBSTATE_ENABLED,TBSTYLE_BUTTON,0L,0),
>
> (STD_FILESAVE,ID_FILE_SAVE,TBSTATE_ENABLED,TBSTYLE_BUTTON,0L,0),
>
> (0,0,TBSTATE_ENABLED,TBSTYLE_SEP,0L,0)};
>
> INITCOMMONCONTROLSEX icex;
>
> icex.dwSize=3Dsizeof(INITCOMMONCONTROLSEX);
>
> icex.dwICC=3DICC_BAR_CLASSES;
>
> InitCommonControlsEx(&icex);
>
> HWND hToolbar=3DCreateToolbarEx(hwnd,
>
> WS_CHILD|WS_VISIBLE|WS_BORDER|TBSTYLE_TOOLTIPS,
>
> ID_TOOLBAR,15,HINST_COMMCTRL,IDB_STD_SMALL_COLOR,
>
> tbButtons,4,0,0,100,30,sizeof(TBBUTTON));
>
> if(hToolbar=3D=3DNULL)
>
> MessageBox(hwnd,"Could not create toolbar","Error",MB_OK|MB_ICONSTOP);
>
> }
>
> break;
>
> Do I need to include some addittional headers?
>
|