Computer not recognizing INITCOMMONCONTROLSEX
Hi,
Though I've found a little bit of discussion about this issue online, nothing I've seen has solved the problem.
Basically the debugger is stopping at
INITCOMMONCONTROLSEX cc;
and saying it doesn't recognize the 'function' INITCOMMONCONTROLSEX. But it should be in <commctrl.h>, correct?
One suggestion I've seen is to go into the commctrl.h file and change some code. But where would you find this file? A search of all files (I'm using CodeBlocks) yields nothing.
I've checked in the Build options and found that comctl32 is included under the list of Link libraries. If that is relevant.
Code:
#include <windows.h>
#include <commctrl.h>
#include <stdio.h>
LRESULT CALLBACK WindowProcedure (HWND, UINT, WPARAM, LPARAM);
char szWinName[]= "MyWin";
HINSTANCE hInstance;
HWND hwnd;
HWND hTabWnd;
int WINAPI WinMain (HINSTANCE hThisInstance,
HINSTANCE hPrevInstance,
LPSTR lpszArgst,
int nWinMode)
{
HWND hwnd;
MSG messages;
WNDCLASSEX wcl;
INITCOMMONCONTROLSEX cc;
wcl.cbSize = sizeof (WNDCLASSEX);
wcl.hInstance = hThisInstance;
wcl.lpszClassName = szWinName;
wcl.lpfnWndProc = WindowProcedure;
wcl.style = CS_DBLCLKS;
wcl.hIcon = LoadIcon (NULL, IDI_APPLICATION);
wcl.hIconSm = LoadIcon (NULL, IDI_APPLICATION);
wcl.hCursor = LoadCursor (NULL, IDC_ARROW);
wcl.lpszMenuName = NULL;
wcl.cbClsExtra = 0;
wcl.cbWndExtra = 0;
wcl.hbrBackground = (HBRUSH) COLOR_BACKGROUND;
if (!RegisterClassEx (&wcl))
return 0;
hwnd = CreateWindowEx (
0,
szClassName,
"Basic Tab Controls Demo",
WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT,
CW_USEDEFAULT,
544,
375,
HWND_DESKTOP,
NULL,
hThisInstance,
NULL
);
ShowWindow (hwnd, nWinMode);
while (GetMessage (&messages, NULL, 0, 0))
{
TranslateMessage(&messages);
/* Send message to WindowProcedure */
DispatchMessage(&messages);
}
return messages.wParam;
}
This is all pretty standard stuff, just included it in case there is something obvious I'm not catching here.
Thanks for any suggestions.