|
From: Vlada D. <dj...@im...> - 2002-09-30 07:35:31
|
Hi, Carlos
Thanks for help, now I can compile, but have another problem: every time
I start the program I get diferent buttons on toolbar, and they are all
disabled. What could be the cause of this?
=20
-----Original Message-----
From: dev...@li...
[mailto:dev...@li...] On Behalf Of Carlos
Garc=EDa del Monte
Sent: petak, 27. septembar 2002 18:15
To: dev-cpp-users-list
Subject: Re: [Dev-C++] toolbar
=20
You must link with the libraries (-lcomctl32). If you need some other,
see at your lib dir.=20
=20
Vlada Djurovic escribi=F3:=20
H!
I want to add a toolbar to my window,so I included <windows.h> and
<commctrl.h>, but I keep getting following messages:=20
173 C:\Visual\Test1\main.cpp=20
`INITCOMMONCONTROLSEX' undeclared (first use this function)=20
173 C:\Visual\Test1\main.cpp=20
parse error before `;'=20
174 C:\Visual\Test1\main.cpp=20
`icex' undeclared (first use this function)=20
176 C:\Visual\Test1\main.cpp=20
implicit declaration of function `int InitCommonControlsEx(...)'=20
here=92s the code:=20
case WM_CREATE:=20
{=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),=20
(0,0,TBSTATE_ENABLED,TBSTYLE_SEP,0L,0)};=20
INITCOMMONCONTROLSEX icex;=20
icex.dwSize=3Dsizeof(INITCOMMONCONTROLSEX);=20
icex.dwICC=3DICC_BAR_CLASSES;=20
InitCommonControlsEx(&icex);=20
HWND hToolbar=3DCreateToolbarEx(hwnd,=20
WS_CHILD|WS_VISIBLE|WS_BORDER|TBSTYLE_TOOLTIPS,=20
ID_TOOLBAR,15,HINST_COMMCTRL,IDB_STD_SMALL_COLOR,=20
tbButtons,4,0,0,100,30,sizeof(TBBUTTON));=20
if(hToolbar=3D=3DNULL)=20
MessageBox(hwnd,"Could not create toolbar","Error",MB_OK|MB_ICONSTOP);=20
}=20
break;=20
Do I need to include some addittional headers?=20
|