CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2009
    Posts
    161

    Error creating list view thru resource.rc

    Hi,

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

    Code:
    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:

    Code:
    // 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...

  2. #2
    Join Date
    Feb 2005
    Posts
    2,160

    Re: Error creating list view thru resource.rc

    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.

  3. #3
    Join Date
    Dec 2009
    Posts
    161

    Re: Error creating list view thru resource.rc

    now it's working! By the way, do you have any idea what those long number mean?

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

  4. #4
    Join Date
    Feb 2005
    Posts
    2,160

    Re: Error creating list view thru resource.rc

    Where's they come from? Looks suspiciously like an unsigned long representation of -2 and -1 respectively.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured