error 1421: "control ID not found"

This is a discussion on error 1421: "control ID not found" within the C Programming forums, part of the General Programming Boards category; I have a dialog box with two listbox controls. Both of them display disk directories and function well (with one ...

  1. #1
    Registered User JustMax's Avatar
    Join Date
    Jan 2009
    Posts
    59

    error 1421: "control ID not found"

    I have a dialog box with two listbox controls. Both of them display disk directories and function well (with one exception. I can move from drive to drive, directory to directory perfectly.

    Now, the exception. As I move down the list, clicking each item once with the mouse, if I click on the 9th item, the dialog closes and returns me to the main screen. I can scroll down with the arrow key and have no problems. I can click on any item (1 through 8) and (10 through the end of the list) without issue.

    I placed a function in to return getLastError and it says the procedures last error was 1421. After searching, I found that 1421 means Control ID Not Found.

    Any ideas what I may have done to cause this?

    Here is the code from the .rc file:

    Code:
    IDD_FILE_XFER DIALOGEX 50, 40, 516, 401
    STYLE DS_ABSALIGN | DS_LOCALEDIT | DS_SETFONT | DS_SETFOREGROUND | WS_POPUP | 
        WS_CAPTION | WS_THICKFRAME
    EXSTYLE WS_EX_TOPMOST | WS_EX_TOOLWINDOW | WS_EX_APPWINDOW
    CAPTION "Marine ICE File Transfer"
    FONT 8, "MS Shell Dlg", 0, 0, 0x0
    BEGIN
        PUSHBUTTON      "E&xit",IDCLOSE,229,239,54,30
        PUSHBUTTON      "==>>",IDC_EXPORT,229,124,54,30
        RADIOBUTTON     "Copy",IDC_RAD_COPY,229,27,54,34,BS_PUSHLIKE
        RADIOBUTTON     "Move",IDC_RAD_MOVE,229,66,54,34,BS_PUSHLIKE
        LISTBOX         IDC_DRIVES_LIST1,7,14,132,25,LBS_SORT | 
                        LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
        PUSHBUTTON      "Delete",IDC_DELETE,229,179,54,45
        LISTBOX         IDC_DRIVES_LIST2,377,14,132,25,LBS_SORT | 
                        LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
        LTEXT           "",IDC_DRIVE1_FILENAME,7,7,132,8
        LTEXT           "",IDC_DRIVE2_FILENAME,377,7,132,8
        LISTBOX         IDC_FILES_LIST2,377,39,132,236,LBS_SORT | 
                        LBS_NOINTEGRALHEIGHT | LBS_DISABLENOSCROLL | LBS_NOSEL | 
                        WS_VSCROLL | WS_TABSTOP
        LISTBOX         IDC_FILES_LIST1,7,39,132,236,LBS_SORT | LBS_NOINTEGRALHEIGHT | 
                        WS_VSCROLL | WS_TABSTOP
    END
    I call the dialog with this:
    Code:
    					DialogBox( g_hInst, MAKEINTRESOURCE( IDD_FILE_XFER ), 
    							hwndDlg, ( DLGPROC )XferDlgProc );
    the procedure "XferDlgProc " is lengthy but I can post it if needed.

    I would appreciate any hints. It has me stumped at this point.

  2. #2
    Registered User JustMax's Avatar
    Join Date
    Jan 2009
    Posts
    59
    I found it. I had left out a '}' and the compiler didn't catch it. I guess I should be more precise. Thanks for you interest.

  3. #3
    C++まいる!Cをこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,549
    Do not cast callback functions, though.
    DialogBox( g_hInst, MAKEINTRESOURCE( IDD_FILE_XFER ),
    hwndDlg, ( DLGPROC )XferDlgProc );
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Windows server 2003 "No active mixer device found"
    By drdodirty2002 in forum Tech Board
    Replies: 1
    Last Post: 01-13-2006, 10:25 AM
  2. Replies: 1
    Last Post: 06-21-2005, 08:10 AM
  3. How can i make a "letter could not be found" break?
    By Welshy in forum C++ Programming
    Replies: 14
    Last Post: 04-12-2005, 02:41 PM
  4. search for int in an array always 'found"
    By kocika73 in forum C Programming
    Replies: 9
    Last Post: 11-21-2004, 02:11 AM
  5. read "control d" from the keyboard
    By Unregistered in forum C++ Programming
    Replies: 1
    Last Post: 08-01-2002, 08:39 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21