首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ >

codeblocks有关问题

2012-09-06 
codeblocks问题C/C++ code#define WIN32_LEAN_AND_MEAN#include windows.h#include commctrl.h#includ

codeblocks问题

C/C++ code
#define WIN32_LEAN_AND_MEAN#include <windows.h>#include <commctrl.h>#include "resource.h"HINSTANCE hInst;BOOL CALLBACK DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam){    HWND lsv;    switch(uMsg)    {        case WM_INITDIALOG:            InitCommonControls();            lsv = GetDlgItem(hwndDlg,IDC_LIST1);            ListView_SetExtendedListViewStyle(lsv,LVS_EX_GRIDLINES | LVS_EX_FULLROWSELECT);            return TRUE;


以上,codeblocks是从论坛下的最新版,编译器用的是TDM-GCC,也是下的最新版,但是编译的时候出现如下错误


C:\mingw_listview_test\main.cpp||In function 'BOOL DialogProc(HWND, UINT, WPARAM, LPARAM)':|
C:\mingw_listview_test\main.cpp|17|error: 'LVS_EX_GRIDLINES' was not declared in this scope|
C:\mingw_listview_test\main.cpp|17|error: 'LVS_EX_FULLROWSELECT' was not declared in this scope|
C:\mingw_listview_test\main.cpp|17|error: 'ListView_SetExtendedListViewStyle' was not declared in this scope|
||=== Build finished: 3 errors, 0 warnings (0 minutes, 3 seconds) ===|
这是怎么回事?

[解决办法]
需要定义WINVER这些东西,版本不够。
查一下头文件:LVS_EX_GRIDLINES 的最低版本需求。

热点排行