Click to See Complete Forum and Search --> : Error creating list view thru resource.rc


THEARTOFWEB
February 14th, 2010, 05:05 PM
Hi,

I am using ResEdit as a resource builder. I created a dialogex like this:


IDD_POPUP DIALOGEX 25, 25, 485, 254
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Show Active Listeners"
FONT 8, "MS Shell Dlg"
BEGIN
CONTROL "", WC_LISTVIEW, IDC_LIST1, WS_TABSTOP | WS_BORDER | LVS_ALIGNLEFT | LVS_REPORT, 489, 230
END


when I compile with VC++ I get this error regarding the resource.rc file


error RC2104 : undefined keyword or key name: WC_LISTVIEW


Ofcourse I added this on top of my stdafx.h:


// Windows Header Files:
#define STRICT
#include <windows.h>
#include <windowsx.h>

#pragma comment (lib, "comctl32.lib")
#include <commctrl.h>

#pragma comment (lib, "UxTheme.lib")
#include "uxtheme.h"


If I try to create the view list thru C code it works...

hoxsiew
February 14th, 2010, 06:02 PM
I don't know what ResEdit is, but the include file commctrl.h must be included in your resource file or in a file included by a resource include. The VS project wizard usually puts this in afxres.h IIRC. Also, make sure NOLISTVIEW is NOT defined somewhere. Borland C++ back in the day (5.0 was the last version I ever used) would define NOxxx to exclude all common controls, then you had to manually un-define the ones you planned to use.

THEARTOFWEB
February 14th, 2010, 06:36 PM
now it's working! By the way, do you have any idea what those long number mean?


CONTROL "", IDC_LIST1, WC_LISTVIEW, WS_TABSTOP | WS_BORDER | LVS_ALIGNLEFT | LVS_REPORT, 4294967294, 4294967295, 489, 230


4294967294, 4294967295 ??

hoxsiew
February 14th, 2010, 06:48 PM
Where's they come from? Looks suspiciously like an unsigned long representation of -2 and -1 respectively.