|
From: Vlada D. <dj...@im...> - 2002-09-27 12:06:02
|
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(...)'
=20
here=92s the code:
case WM_CREATE:
{
=20
TBBUTTON tbButtons[]=3D
=20
{(STD_FILENEW,ID_FILE_NEW,TBSTATE_ENABLED,TBSTYLE_BUTTON,0L,0),
=20
(STD_FILEOPEN,ID_FILE_OPEN,TBSTATE_ENABLED,TBSTYLE_BUTTON,0L,0),
=20
(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;
=20
Do I need to include some addittional headers?
=20
|