Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. control RESOURCE definition

control RESOURCE definition

Scheduled Pinned Locked Moved C / C++ / MFC
learning
12 Posts 5 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F ForNow

    For the class parameter the documentation says a redefined name (not sure what that means) the reason I am asking I am using a control for which I have a specific WNDCLASS which I registered however the CDialog::Create fails with that control statement in the resource definition Thanks

    L Offline
    L Offline
    Lost User
    wrote on last edited by
    #2

    We need to see the code and a bit more detail. If the control is not known at build time then the resource compiler may well have a problem.

    1 Reply Last reply
    0
    • F ForNow

      For the class parameter the documentation says a redefined name (not sure what that means) the reason I am asking I am using a control for which I have a specific WNDCLASS which I registered however the CDialog::Create fails with that control statement in the resource definition Thanks

      S Offline
      S Offline
      Stefan_Lang
      wrote on last edited by
      #3

      As Richard said, we need more information: - what is "the class parameter"? - what is "the documentation" you are referring to? - what is "the CDialog::Create"? - also: in what way does it "fail"? Is there a compiler, linker or run-time error, and what does it say? Or does you program not behave in the expected way - if so, how, and what did you expect? You are apparently referring to very specific things, but we have no idea what you're seeing or reading. (or whether that is relevant information to start with)

      GOTOs are a bit like wire coat hangers: they tend to breed in the darkness, such that where there once were few, eventually there are many, and the program's architecture collapses beneath them. (Fran Poretto)

      F 1 Reply Last reply
      0
      • S Stefan_Lang

        As Richard said, we need more information: - what is "the class parameter"? - what is "the documentation" you are referring to? - what is "the CDialog::Create"? - also: in what way does it "fail"? Is there a compiler, linker or run-time error, and what does it say? Or does you program not behave in the expected way - if so, how, and what did you expect? You are apparently referring to very specific things, but we have no idea what you're seeing or reading. (or whether that is relevant information to start with)

        GOTOs are a bit like wire coat hangers: they tend to breed in the darkness, such that where there once were few, eventually there are many, and the program's architecture collapses beneath them. (Fran Poretto)

        F Offline
        F Offline
        ForNow
        wrote on last edited by
        #4

        Here are the resource statements Here is the call The resource in question is IDC_CUSTOM5 Fail means that when I comment out that CONTROL staement tracing my code the create goes to my

        OnInitDialog

        my question is in the class parm of the resource control can it be my own class which I register at run time via RegesterClass thank you

        BOOL ret2 = drivestorage->Create(IDD_DIALOG10, m_pMainWnd);

        IDD_DIALOG10 DIALOGEX 0, 0, 769, 429
        STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
        CAPTION "Storage View / Change"
        FONT 8, "MS Shell Dlg", 400, 0, 0x1
        BEGIN
        CTEXT "",IDC_TCB,45,30,47,8
        CTEXT "OwnIng TCB",IDC_STATIC,41,13,58,8
        CTEXT "",IDC_SP,164,28,43,8
        CTEXT "Storage SubPool",IDC_STATIC,162,12,55,8
        CTEXT "",IDC_ASID,265,26,32,8
        CTEXT "Asid",IDC_STATIC,269,9,31,8
        CTEXT "",IDC_FP,399,31,19,8
        CTEXT "Fetch Protect Key",IDC_STATIC,392,15,63,8
        CONTROL "",IDC_CUSTOM5,"PieCOntrol",WS_TABSTOP,617,99,109,109
        COMBOBOX IDC_COMBO1,491,236,48,30,CBS_DROPDOWN | CBS_SORT | WS_VSCROLL | WS_TABSTOP
        CONTROL "",IDC_EDIT2,"RichEdit20A",ES_MULTILINE | WS_BORDER | WS_TABSTOP, 45,106,494,314
        EDITTEXT IDC_EDIT1,45,110,494,314,ES_AUTOHSCROLL
        COMBOBOX IDC_COMBO2,637,244,67,16,CBS_DROPDOWN | CBS_SORT | WS_VSCROLL | WS_TABSTOP
        LISTBOX IDC_LIST2,641,310,68,11,LBS_SORT | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
        END

        L Mircea NeacsuM 2 Replies Last reply
        0
        • F ForNow

          For the class parameter the documentation says a redefined name (not sure what that means) the reason I am asking I am using a control for which I have a specific WNDCLASS which I registered however the CDialog::Create fails with that control statement in the resource definition Thanks

          V Offline
          V Offline
          Victor Nijegorodov
          wrote on last edited by
          #5

          You may want to look at this Joe Newcomer's essay: [Self-Registering Window Classes](http://www.flounder.com/selfregister.htm)

          F 1 Reply Last reply
          0
          • V Victor Nijegorodov

            You may want to look at this Joe Newcomer's essay: [Self-Registering Window Classes](http://www.flounder.com/selfregister.htm)

            F Offline
            F Offline
            ForNow
            wrote on last edited by
            #6

            Thank you

            1 Reply Last reply
            0
            • F ForNow

              Here are the resource statements Here is the call The resource in question is IDC_CUSTOM5 Fail means that when I comment out that CONTROL staement tracing my code the create goes to my

              OnInitDialog

              my question is in the class parm of the resource control can it be my own class which I register at run time via RegesterClass thank you

              BOOL ret2 = drivestorage->Create(IDD_DIALOG10, m_pMainWnd);

              IDD_DIALOG10 DIALOGEX 0, 0, 769, 429
              STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
              CAPTION "Storage View / Change"
              FONT 8, "MS Shell Dlg", 400, 0, 0x1
              BEGIN
              CTEXT "",IDC_TCB,45,30,47,8
              CTEXT "OwnIng TCB",IDC_STATIC,41,13,58,8
              CTEXT "",IDC_SP,164,28,43,8
              CTEXT "Storage SubPool",IDC_STATIC,162,12,55,8
              CTEXT "",IDC_ASID,265,26,32,8
              CTEXT "Asid",IDC_STATIC,269,9,31,8
              CTEXT "",IDC_FP,399,31,19,8
              CTEXT "Fetch Protect Key",IDC_STATIC,392,15,63,8
              CONTROL "",IDC_CUSTOM5,"PieCOntrol",WS_TABSTOP,617,99,109,109
              COMBOBOX IDC_COMBO1,491,236,48,30,CBS_DROPDOWN | CBS_SORT | WS_VSCROLL | WS_TABSTOP
              CONTROL "",IDC_EDIT2,"RichEdit20A",ES_MULTILINE | WS_BORDER | WS_TABSTOP, 45,106,494,314
              EDITTEXT IDC_EDIT1,45,110,494,314,ES_AUTOHSCROLL
              COMBOBOX IDC_COMBO2,637,244,67,16,CBS_DROPDOWN | CBS_SORT | WS_VSCROLL | WS_TABSTOP
              LISTBOX IDC_LIST2,641,310,68,11,LBS_SORT | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
              END

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #7

              ForNow wrote:

              can it be my own class which I register at run time via RegesterClass

              I am not sure as I have never tried that. The documentation at CONTROL control - Win32 apps | Microsoft Docs[^] states (although it is slightly ambiguous) that it must be one of the predefined classes. If your code is failing when you try it with a locally defined class then you need to use the debugger to find out why.

              F 1 Reply Last reply
              0
              • L Lost User

                ForNow wrote:

                can it be my own class which I register at run time via RegesterClass

                I am not sure as I have never tried that. The documentation at CONTROL control - Win32 apps | Microsoft Docs[^] states (although it is slightly ambiguous) that it must be one of the predefined classes. If your code is failing when you try it with a locally defined class then you need to use the debugger to find out why.

                F Offline
                F Offline
                ForNow
                wrote on last edited by
                #8

                I think the documentation means you have to Register the Class before calling CDialog::Create as I remember I forgot to call AfxInitRichEdit before doing a CDialog::Create and it failed I think CDialog::Create Checks Uid template dialog resource and sees if the classes are registered Thanks you

                L 1 Reply Last reply
                0
                • F ForNow

                  I think the documentation means you have to Register the Class before calling CDialog::Create as I remember I forgot to call AfxInitRichEdit before doing a CDialog::Create and it failed I think CDialog::Create Checks Uid template dialog resource and sees if the classes are registered Thanks you

                  L Offline
                  L Offline
                  Lost User
                  wrote on last edited by
                  #9

                  I assumed you were doing that anyway, since Windows cannot create an object of a class that it does not know about.

                  1 Reply Last reply
                  0
                  • F ForNow

                    Here are the resource statements Here is the call The resource in question is IDC_CUSTOM5 Fail means that when I comment out that CONTROL staement tracing my code the create goes to my

                    OnInitDialog

                    my question is in the class parm of the resource control can it be my own class which I register at run time via RegesterClass thank you

                    BOOL ret2 = drivestorage->Create(IDD_DIALOG10, m_pMainWnd);

                    IDD_DIALOG10 DIALOGEX 0, 0, 769, 429
                    STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
                    CAPTION "Storage View / Change"
                    FONT 8, "MS Shell Dlg", 400, 0, 0x1
                    BEGIN
                    CTEXT "",IDC_TCB,45,30,47,8
                    CTEXT "OwnIng TCB",IDC_STATIC,41,13,58,8
                    CTEXT "",IDC_SP,164,28,43,8
                    CTEXT "Storage SubPool",IDC_STATIC,162,12,55,8
                    CTEXT "",IDC_ASID,265,26,32,8
                    CTEXT "Asid",IDC_STATIC,269,9,31,8
                    CTEXT "",IDC_FP,399,31,19,8
                    CTEXT "Fetch Protect Key",IDC_STATIC,392,15,63,8
                    CONTROL "",IDC_CUSTOM5,"PieCOntrol",WS_TABSTOP,617,99,109,109
                    COMBOBOX IDC_COMBO1,491,236,48,30,CBS_DROPDOWN | CBS_SORT | WS_VSCROLL | WS_TABSTOP
                    CONTROL "",IDC_EDIT2,"RichEdit20A",ES_MULTILINE | WS_BORDER | WS_TABSTOP, 45,106,494,314
                    EDITTEXT IDC_EDIT1,45,110,494,314,ES_AUTOHSCROLL
                    COMBOBOX IDC_COMBO2,637,244,67,16,CBS_DROPDOWN | CBS_SORT | WS_VSCROLL | WS_TABSTOP
                    LISTBOX IDC_LIST2,641,310,68,11,LBS_SORT | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
                    END

                    Mircea NeacsuM Offline
                    Mircea NeacsuM Offline
                    Mircea Neacsu
                    wrote on last edited by
                    #10

                    I've never tried it so I'm not sure exactly how it works but I notice a rather strange capitalization in you class name: "PieCOntrol". I don't know if Windows is case sensitive or not when looking for class name.

                    Mircea

                    F V 2 Replies Last reply
                    0
                    • Mircea NeacsuM Mircea Neacsu

                      I've never tried it so I'm not sure exactly how it works but I notice a rather strange capitalization in you class name: "PieCOntrol". I don't know if Windows is case sensitive or not when looking for class name.

                      Mircea

                      F Offline
                      F Offline
                      ForNow
                      wrote on last edited by
                      #11

                      Thanks that’s they way I had it in my wndclass I am displaying a pie chart on the side of a dialog box but need a Cwnd class to hang it off of thats the class I’m using for it used the cpiedemo from this site for learning

                      1 Reply Last reply
                      0
                      • Mircea NeacsuM Mircea Neacsu

                        I've never tried it so I'm not sure exactly how it works but I notice a rather strange capitalization in you class name: "PieCOntrol". I don't know if Windows is case sensitive or not when looking for class name.

                        Mircea

                        V Offline
                        V Offline
                        Victor Nijegorodov
                        wrote on last edited by
                        #12

                        According to this discussion: [winapi - Are Windows window classes case-sensitive? - Stack Overflow](https://stackoverflow.com/questions/7928592/are-windows-window-classes-case-sensitive) and the link to [About Atom Tables - Win32 apps | Microsoft Docs](https://docs.microsoft.com/en-us/windows/win32/dataxchg/about-atom-tables?redirectedfrom=MSDN) the window class name is case insensitive.

                        1 Reply Last reply
                        0
                        Reply
                        • Reply as topic
                        Log in to reply
                        • Oldest to Newest
                        • Newest to Oldest
                        • Most Votes


                        • Login

                        • Don't have an account? Register

                        • Login or register to search.
                        • First post
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • World
                        • Users
                        • Groups